Typescript Error Handling In Postgresql