Skip to content

Test that originalError is set for unique keys#89

Open
kevinburkeshyp wants to merge 1 commit intobalderdashy:masterfrom
kevinburke:add-original-error
Open

Test that originalError is set for unique keys#89
kevinburkeshyp wants to merge 1 commit intobalderdashy:masterfrom
kevinburke:add-original-error

Conversation

@kevinburkeshyp
Copy link
Copy Markdown
Contributor

It's set for WLError, but at least one library clobbers the original error
message when creating a WLValidationError. Test that this property exists.

Um, a little uncertain about the best practice here - I only use/care about one library, and I don't expect this to be implemented anywhere else, though I believe it should be, obviously.

Specifically: sails-postgresql currently creates its own error and discards the native Postgres error when a uniqueness check fails. I would like to keep the Postgres error around as originalError, the same way it is for any non-23505 && non-"Key ... already exists" error message. This passes for the sails-postgresql adapter (though many other tests fail; haven't looked into why).

It's set for WLError, but at least one library clobbers the original error
message when creating a WLValidationError. Test that this property exists.
@kevinburkeshyp
Copy link
Copy Markdown
Contributor Author

Sorry, this will pass for sails-postgresql once balderdashy/sails-postgresql#180 is merged.

@dmarcelino
Copy link
Copy Markdown
Member

It's not just sails-postgresql but also sails-memory and sails-mysql that are failing. Those will need fixing before we can merge this test.

https://travis-ci.org/balderdashy/waterline-adapter-tests/jobs/75691934#L606

 ------------------------------------------------------------------ 
| adapter          | version | result | failed | total | wl-sequel |
|------------------|---------|--------|--------|-------|-----------|
| sails-postgresql | dfb2229 | failed |      1 |   344 |     0.5.0 |
| sails-memory     | 4281ad7 | failed |      1 |   324 |           |
| sails-disk       | e95628b | passed |      0 |   312 |           |
| sails-mongo      | 021ec02 | passed |      0 |   312 |           |
| sails-mysql      | 1fe7b2c | failed |      1 |   349 |     0.5.0 |
| sails-redis      | ecb7795 | passed |      0 |   312 |           |
 ------------------------------------------------------------------- 

@particlebanana
Copy link
Copy Markdown
Contributor

@dmarcelino merged balderdashy/sails-postgresql#180 so we just need to look at the others.

particlebanana added a commit to balderdashy/sails-mysql that referenced this pull request Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants