Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 855fc4a

Browse files
dominicletzConnorRigby
authored andcommitted
Reraising exception in caller context
1 parent 43ed1a4 commit 855fc4a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/sqlitex.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ defmodule Sqlitex do
189189
try do
190190
{:ok, apply(fun, args)}
191191
rescue
192-
error -> {:error, {error, __STACKTRACE__}}
192+
error -> {:rescued, error, __STACKTRACE__}
193193
end
194194
end
195195
end

lib/sqlitex/server.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,13 @@ defmodule Sqlitex.Server do
215215
{:ok, [[{:id, 42}]]}
216216
"""
217217
def with_transaction(pid, fun, opts \\ []) do
218-
call(pid, {:with_transaction, fun}, opts)
218+
case call(pid, {:with_transaction, fun}, opts) do
219+
{:rescued, error, trace} ->
220+
Kernel.reraise(error, trace)
221+
222+
other ->
223+
other
224+
end
219225
end
220226

221227
## Helpers

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy