-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
Change file destroy error message #1257
Change file destroy error message #1257
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1257 +/- ##
=======================================
Coverage 99.98% 99.98%
=======================================
Files 57 57
Lines 5407 5409 +2
Branches 1204 1204
=======================================
+ Hits 5406 5408 +2
Misses 1 1
Continue to review full report at Codecov.
|
There is a failing test. You also need to change the message in the test case. |
@mtrezza can you fix the test and update from master for the CI? |
Could you check again? I can now see. The Github Actions logs are little bit buggy. Sometimes I had to refresh the page to see the data. |
@mtrezza you can run the test locally and find the failing test. |
Thanks, I can see the log output in the CI here now too. The error was that the error message was different in the test vs. in the method. That confirms that it could be beneficial to consolidate the Parse Error codes and messages into their own repo at some point in the future. Back to the test here, it throws just an Line 323 in f50b94e
On the other hand in the docs we describe a ParseError that is not defined in the SDK and the error code and message are not referenced anywhere in Parse JS SDK or Parse Server:
The blame line shows it has been added 6 years ago, so it was also not a recently added feature that may not have been merged yet. What do you think about adding the |
I would prefer some consistency. Now that you mention there are a few TypeError being thrown instead of Parse.Error. |
By consistency you mean we should throw a proper Parse.Error and use the Edit: actually I think for the sake of proper testing we'd have to introduce a new Parse Error, otherwise we wouldn't know if a test fails because of unnamed file or another reason. |
I found the missing Parse Error with error number 153 instead of 131 as documented: Parse-SDK-JS/src/ParseError.js Lines 338 to 344 in f24bd99
And it's thrown in Parse Sever when deleting a file fails for an unspecified reason, as in this test case: Parse-SDK-JS/integration/test/ParseFileTest.js Lines 107 to 117 in 7cf413e
Since the error is thrown for unspecified errors when deleting a file, it makes sense to introduce a new Parse Error for this PR, unless there is a contra argument. |
Incorrect error number fixed in parse-community/docs#803 |
I have opened #1269 for this. |
had to change error code again because it was already used
Ready for review, added new Parse Error for when trying to delete an un-named file. |
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!
Improving the error message when deleting an unnamed file.
The current error message mentions an "unsaved" file, while checking for a file name.
To be more specific, the error message should mention an "unnamed" file.
As discussed in parse-community/docs#791 (comment).