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

Update PostgresStorageAdapter.js #2093

Merged
merged 1 commit into from
Jul 9, 2016
Merged

Update PostgresStorageAdapter.js #2093

merged 1 commit into from
Jul 9, 2016

Conversation

vitaly-t
Copy link
Contributor

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 ;)

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 ;)
@codecov-io
Copy link

Current coverage is 92.07%

Merging #2093 into master will decrease coverage by <.01%

@@             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          

Powered by Codecov. Last updated by 006540c...bd98bf4

if (result.length === 1) {
return result[0].schema;
} else {
return this._client.one('SELECT * FROM "_SCHEMA" WHERE "className"=$<className>', { className }, res=>res.schema)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add some spaces here: res=>res.schema ?

@flovilmart
Copy link
Contributor

DO you want tho throw back the error and handle it correctly? (at lease with a logger.error())

@vitaly-t
Copy link
Contributor Author

The result from method one will throw error, if it fails to get anything other than 1 record.

@drew-gross
Copy link
Contributor

Looks good to me, merging. We can still change the getClass API if we want, though, it's not stable/public yet.

@drew-gross
Copy link
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.

@vitaly-t vitaly-t deleted the patch-1 branch July 9, 2016 10:13
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 ;)
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 this pull request may close these issues.

4 participants