-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Include stack in Cloud Code #6958
Conversation
Danger run resulted in 1 fail and 1 markdown; to find out more, see the checks page. Generated by 🚫 dangerJS |
I was just thinking about this error handling. |
Codecov Report
@@ Coverage Diff @@
## master #6958 +/- ##
==========================================
- Coverage 93.80% 93.79% -0.02%
==========================================
Files 169 169
Lines 12254 12255 +1
==========================================
- Hits 11495 11494 -1
- Misses 759 761 +2
Continue to review full report at Codecov.
|
@dplewis would you have any suggestions / pointers as to how to get relevant trace if a Parse.Error is thrown? The solution in this PR only works if if a JS error is thrown. E.g:
Throws
Which again, isn't overly helpful at identifying where the error is comes from. Obviously, you can wrap it in a try / catch block, but just thinking how we can make it as novice-friendly as possible. |
There was a conversation about this. #6205 (comment) One place to start would be to remove the promise chaining that happens in the rest, restquery, restwrite, etc. I can do this in a separate PR. There may be simpler solution. Edit: its easier to test this with |
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.
LGTM!
At the moment in Cloud Code, if an error is thrown from a syntax / JS error, such as:
The following error is shown:
Which can make it a bit difficult sometimes to trace when your main.js is long.
This PR passes stack through if the error thrown is an
Error
, meaning that the following is logged, making it a bit easier to identify where the syntax error was.Sorry for submitting so many PRs!