Skip to content

Conversation

ArjunCodess
Copy link

@ArjunCodess ArjunCodess commented Oct 1, 2025

fixes #77

Changes:

  • Fixed isJSON() to return false instead of throwing errors
  • Added specific JSON syntax error detection in createFromUrlOrRawJson()
  • Improved error messages in createFromUrl.ts to show "Invalid JSON" with actual parsing error

Before: Generic "Unknown error" for invalid JSON
After: Clear error messages like "Invalid JSON: Expected double-quoted property name in JSON at position 27"

Files changed:

  • app/jsonDoc.server.ts
  • app/routes/actions/createFromUrl.ts

- Add JSON parsing validation to throw a specific error for invalid JSON syntax
- Update error handling in createFromUrl action to provide clearer feedback for invalid JSON errors
- Maintain existing functionality while improving user feedback on errors
@ArjunCodess ArjunCodess changed the title fix(json): enhance JSON error handling in createFromUrlOrRawJson enhance JSON error handling in createFromUrlOrRawJson Oct 1, 2025
@ArjunCodess ArjunCodess changed the title enhance JSON error handling in createFromUrlOrRawJson enhance JSON error handling Oct 1, 2025
@ArjunCodess
Copy link
Author

@matt-aitken hey! :)

if there is anything left to implement / anything to be edited, please let me know!

@ArjunCodess ArjunCodess closed this Oct 1, 2025
@ArjunCodess ArjunCodess reopened this Oct 1, 2025
@ArjunCodess
Copy link
Author

(closed it by mistake, im sorry)

@ArjunCodess
Copy link
Author

@matt-aitken just a follow-up.

1 similar comment
@ArjunCodess
Copy link
Author

@matt-aitken just a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement error message when JSON is invalid syntax
1 participant