Skip to content

Caught errors within transactions still thrown as uncaught #455

Open
@issa-tseng

Description

@issa-tseng

maybe it's just me, but i find this surprising:

sql.begin((tsql) =>
  tsql`select * from nonexistent`
    .then(console.log)
    .catch((ex) => Promise.resolve('no no it's fine everything is okay'))
).catch((ex) => console.log('got:', ex));
// got: PostgresError: relation "nonexistent" does not exist

i feel like this should not result in an error at all. i handled it, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions