Error handling

Hi,
Currently this how I handle the database error thrown from Drizzle,
try {
  ...
} catch (error) {
  if (error.sqlMessage) {
    // toast a message "There was database error, contact administrator"
  } else {
    ...
  }
}

Is this the correct way to check if it is a database error?
Was this page helpful?