Update PostgresStorageAdapter.js#2093
Merged
drew-gross merged 1 commit intoparse-community:masterfrom Jul 9, 2016
vitaly-t:patch-1
Merged
Update PostgresStorageAdapter.js#2093drew-gross merged 1 commit intoparse-community:masterfrom vitaly-t:patch-1
drew-gross merged 1 commit intoparse-community:masterfrom
vitaly-t:patch-1
Conversation
If it really needs to reject with `undefined`, then this is the right way. Usually one just returns the result, let the caller provide the `.catch` ;) This way real errors can be swallowed, not very good ;)
Current coverage is 92.07%@@ master #2093 diff @@
==========================================
Files 93 93
Lines 6777 6775 -2
Methods 1193 1194 +1
Messages 0 0
Branches 1433 1432 -1
==========================================
- Hits 6240 6238 -2
Misses 537 537
Partials 0 0
|
| if (result.length === 1) { | ||
| return result[0].schema; | ||
| } else { | ||
| return this._client.one('SELECT * FROM "_SCHEMA" WHERE "className"=$<className>', { className }, res=>res.schema) |
Contributor
There was a problem hiding this comment.
can we add some spaces here: res=>res.schema ?
Contributor
|
DO you want tho throw back the error and handle it correctly? (at lease with a |
Contributor
Author
|
The result from method |
Contributor
|
Looks good to me, merging. We can still change the getClass API if we want, though, it's not stable/public yet. |
Contributor
|
NVM reverted, this will change behaviour. The expected behaviour is to reject with undefined if the class doesn't exist, and reject with something else if there was some other error. As I said, though, we can change that. |
rsouzas
pushed a commit
to back4app/parse-server
that referenced
this pull request
Mar 15, 2017
If it really needs to reject with `undefined`, then this is the right way. Usually one just returns the result, let the caller provide the `.catch` ;) This way real errors can be swallowed, not very good ;)
rsouzas
pushed a commit
to back4app/parse-server
that referenced
this pull request
Mar 16, 2017
If it really needs to reject with `undefined`, then this is the right way. Usually one just returns the result, let the caller provide the `.catch` ;) This way real errors can be swallowed, not very good ;)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If it really needs to reject with
undefined, then this is the right way. Usually one just returns the result, let the caller provide the.catch;)This way real errors can be swallowed, not very good ;)