Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show errors during serialization/deserialization #322

Closed
nflaig opened this issue May 2, 2023 · 0 comments · Fixed by #323
Closed

Show errors during serialization/deserialization #322

nflaig opened this issue May 2, 2023 · 0 comments · Fixed by #323

Comments

@nflaig
Copy link
Member

nflaig commented May 2, 2023

@g11tech yes was able to verify it works and looks correct locally, something I noticed during testing is that there is no error shown when trying to serialize/deserialize invalid data, it only logs an error to the console. This is also the case on the live website (https://simpleserialize.com/).

For example:

caught (in promise) RangeError: Offset is outside the bounds of the DataView
    at DataView.getUint32 (<anonymous>)
    at readVariableOffsets (container.js:322:1)
    at ContainerType.getFieldRanges (container.js:290:1)
    at ContainerType.value_deserializeFromBytes (container.js:125:1)
    at ContainerType.deserialize (abstract.js:45:1)
    at Object.parse (input_types.ts:21:32)
    at Input._callee3$ (Input.tsx:117:30)
    at tryCatch (runtime.js:63:16)
    at Generator.invoke [as _invoke] (runtime.js:294:1)
    at Generator.next (runtime.js:119:1)

Maybe catch the error and show a simple browser alert?

Originally posted by @nflaig in #321 (comment)

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 a pull request may close this issue.

1 participant