This PR migrates errors from js -> ts, under the new proposal (see here).
Closes IS-211
Solution
add code property to the base error - will be inherited by our errors so it's less onerous on devs
change errors from js -> ts
this was done by renaming the file, then changing the super call to take an object. only BadRequestError has a change
add LegacyErrors - should use as a marker. when can't find in codebase, we know migration is done
stricter type enforcement on our error types using template literal types + const obj - we want devs to go through our constants to get the values or pass only the correct values. if we don't use as const/template literal, this enforcement isn't done as the type is string
add a very simple test spec for errors - just testing the code property works as expected
Problem
This PR migrates errors from js -> ts, under the new proposal (see here).
Closes IS-211
Solution
code
property to the base error - will be inherited by our errors so it's less onerous on devssuper
call to take an object. onlyBadRequestError
has a changeLegacyErrors
- should use as a marker. when can't find in codebase, we know migration is doneconst obj
- we want devs to go through our constants to get the values or pass only the correct values. if we don't useas const
/template literal, this enforcement isn't done as the type isstring
code
property works as expected