-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Enhanced Error Reporting for Improved Debugging and User Experience #100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary spaces in websocket.ts
hey @Kanai2003, thanks for your review those spaces are for indentation. Any issue related to formatting will be resolved if my PR for integrating es-lint and prettier gets merged |
Oh! my bad! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Sadaf-A, Thanks for sending this pull request. I would like to skip adding these suggestions due to the following reasons:
- It's up to app developers handle Neutralinojs errors - not the framework itself. i.e.,
clipboard.writeText()
throws an error, so app developers need to handle it withtry/catch
- We realdy expose error code types for TypeScript
However, if more app developers mention that they need to see all uncaught errors on the console as formatted error messages, we can do something like this I think:
nativeCalls[message.id].reject(message.data.error);
if(onDebugMode) {
logError(); // <----
}
Let's skip adding this feature for now 🎉
Hey, thanks for the review. From that perspective it makes more sense to keep things the way they are! |
Resolves: #99
This PR adds a new
class
for throwing errors and gives moredescriptive errors
This is what our errors look like now:
This is what they will look like after the changes introduced by this PR are merged:
This PR also makes the
sendMessage()
method inwebsocket.ts
async which is required to get the propererror object