Handling errors in Expo
Im using the setup provided at https://orm.drizzle.team/docs/connect-expo-sqlite. While developing today I stumbled across an UNIQUE constraint error which was expected. When looking at the error in the catch clause I noticed that the Error was just a plain JavaScript Error which makes it hard to parse the errors and handle them correctly, example:
Error: Call to function 'NativeStatement.runSync' has been rejected.
→ Caused by: Error code : UNIQUE constraint failed: column1, column2
at construct (native)
at apply (native)
Is there a recommended way to handle this?
0 Replies