Skip to content

Errors need to be classes instead of interfaces so that they can be used as values (e.g. with instanceof)#19

Merged
vitaly-t merged 1 commit into
vitaly-t:masterfrom
heikkipora:master
Nov 11, 2025
Merged

Errors need to be classes instead of interfaces so that they can be used as values (e.g. with instanceof)#19
vitaly-t merged 1 commit into
vitaly-t:masterfrom
heikkipora:master

Conversation

@heikkipora
Copy link
Copy Markdown
Contributor

Example code snippet that did work on earlier spex versions but does not work with current release:

import spex from 'spex'
const {BatchError} = spex.errors

..

if (e instanceof BatchError) {
  // proceed to do stuff with e.getErrors()
}

This PR will revert the relevant changes made in d9d40f9#diff-ed54ac027337bce297669fa4cac590aa3fd86567cd32bf84d8fb48881e27d9f7

@vitaly-t vitaly-t merged commit 4c72261 into vitaly-t:master Nov 11, 2025
3 checks passed
@vitaly-t
Copy link
Copy Markdown
Owner

vitaly-t commented Nov 11, 2025

@heikkipora Thanks! I have released v4.1.0 with this fix. Plus, pg-promise v12.3.0 now uses it.

@heikkipora
Copy link
Copy Markdown
Contributor Author

Thanks for a quick reaction & release!

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.

2 participants