Skip to content

Commit

Permalink
bug fix: praxly doesn't init when url is malformed
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMayfield committed Oct 24, 2024
1 parent bacafd6 commit a3e8474
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ class Praxly_input {
try {
const result = await consoleInput();
return new Praxly_String(result, this.json);
} catch (e) {
}
catch (error) {
throw new PraxlyError("input canceled", this.json.line);
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,11 @@ function parseUrlConfiguration() {
const pattern = '#code=';
if (hash.startsWith(pattern)) {
let source = hash.substring(pattern.length);
configuration.code = decodeURIComponent(source);
try {
configuration.code = decodeURIComponent(source);
} catch (error) {
configuration.code = '// Unable to get code from URL\n// '+ error + '\n';
}
} else {
configuration.code = null;
}
Expand Down

0 comments on commit a3e8474

Please sign in to comment.