diff --git a/src/common/errors.js b/src/common/errors.js index f0641d7..49c216f 100644 --- a/src/common/errors.js +++ b/src/common/errors.js @@ -49,3 +49,13 @@ export class HTTPError extends Error { this.name = 'HTTPError'; } } + +/** + * Error indicating a project cannot be accessed, perhaps because it's unshared, doesn't exist, or has an invalid ID. + */ +export class CannotAccessProjectError extends Error { + constructor (message) { + super(message); + this.name = 'CannotAccessProjectError'; + } +} diff --git a/src/locales/en.json b/src/locales/en.json index 5775127..b891ae4 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -33,6 +33,14 @@ "string": "This version of the packager appears to be outdated. Please refresh and try again.", "context": "Error displayed when the packager detects that you are using an old version and that you must refresh to continue." }, + "cannotAccessProject": { + "string": "Can't access project metadata. This probably means the project is unshared, never existed, or the ID is invalid.", + "context": "Part of the error modal when loading an unshared project." + }, + "cannotAccessProjectCaching": { + "string": "If the project was shared recently, it may take up to an hour for this message to go away.", + "context": "Part of the error modal when loading an unshared project." + }, "close": { "string": "Close" }, @@ -84,6 +92,9 @@ "compressingProject": { "string": "Compressing project" }, + "loadingProjectMetadata": { + "string": "Downloading project metadata" + }, "loadingProjectData": { "string": "Downloading project data" }, @@ -137,13 +148,17 @@ "string": "No file selected", "context": "Error message" }, - "uncertainty": { - "string": "May 8, 2022 - The future of packaging unshared projects is unknown due to upcoming changes to the Scratch API. {moreInformation}.", - "context": "The Scratch Team is probably going to prevent third-party sites from accessing unshared projects. This describes the situation. The date is when this notice was added so that people can understand that this is a new notice." + "unsharedProjects": { + "string": "Unshared projects are no longer accessible using their project ID due to Scratch API changes. Instead, you can either share the project or save the project to your computer (File > Save to your computer) and load the file in the packager.", + "context": "Warning message about unshared projects no longer being accessible." }, - "uncertaintyMore": { - "string": "More information", - "context": "Link to more information about the Scratch Team probably going to prevent third-party sites from accessing unshared projects." + "unsharedProjectsTemporary": { + "string": "Unshared projects will no longer accessible using their project ID in the near future due to upcoming Scratch API changes. Instead, you can either share the project or save the project to your computer (File > Save to your computer) and load the file in the packager.", + "context": "Temporary warning message about unshared projects not being accessible in the FUTURE. Will be replaced with similar message after the changes are implemented." + }, + "unsharedProjectsMore": { + "string": "For more information, visit: {link}", + "context": "Link to learn more about the state of unshared projects." } }, "options": { diff --git a/src/p4/Modals.svelte b/src/p4/Modals.svelte index 9dbf51b..01199b2 100644 --- a/src/p4/Modals.svelte +++ b/src/p4/Modals.svelte @@ -1,7 +1,7 @@