MatteoGioioso / MatteoGioioso/serverless-pg

Add explicit opt-out for error swallowing

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

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
JavaScript
Stars
324
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Might be better to add an explicit opt-out to swallow internal errors:

```javascript
} catch (e){
if(this._config.errorSwallow){
this._logger("Swallowed internal error", e.message)
// Swallow the error, if this produce an error there is no need to error the function

return {
rows: []
}
} else {
throw e
}
}
```

Contributor guide

Open the contributing guide

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 locating the error-handling catch block that returns { rows: [] }, then review how _config is defined and how internal errors are logged. Done means the swallowing behavior can be explicitly controlled through the proposed errorSwallow setting, with errors otherwise rethrown.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, postgresql
Domain
backend, database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.