porsager / porsager/postgres

Global error handler

Open
#758 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
8.7k
Forks
374
Avg merge
11d 16h
Merged PRs (30d)
1

Description

Hi!

First off, thanks a lot for this great project!

I have a use case where I want to be able to catch any errors thrown by my sql client globally. I've tried making a wrapper but had some issues with NOT_TAGGED_CALL errors.

Best case, there would be some onError callback in the options passed to the client initialisation. But barring that, is there any other way to catch errors globally for the sql client instead of sprinkling try/catch around every single query?

Thank you! 🙏

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the client initialisation options and the query error path, with particular attention to NOT_TAGGED_CALL errors and the reported wrapper approach. Define the scope of global handling and what an onError callback should cover; done means the supported behavior is agreed and documented with appropriate coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgresql
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.