Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jens Nolte
quasar
Commits
b1bd5497
Commit
b1bd5497
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Do not wrap exceptions from async when invoking exception handler
Co-authored-by:
Jan Beinke
<
git@janbeinke.com
>
parent
fd781fd6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Quasar/Async.hs
+1
-1
1 addition, 1 deletion
src/Quasar/Async.hs
src/Quasar/Async/Unmanaged.hs
+3
-1
3 additions, 1 deletion
src/Quasar/Async/Unmanaged.hs
with
4 additions
and
2 deletions
src/Quasar/Async.hs
+
1
−
1
View file @
b1bd5497
...
...
@@ -36,7 +36,7 @@ async action = asyncWithUnmask \unmask -> unmask action
asyncWithUnmask
::
MonadResourceManager
m
=>
((
ResourceManagerIO
a
->
ResourceManagerIO
a
)
->
ResourceManagerIO
r
)
->
m
(
Awaitable
r
)
asyncWithUnmask
action
=
do
resourceManager
<-
askResourceManager
asyncWithHandlerAndUnmask
(
throwToResourceManager
resourceManager
)
action
asyncWithHandlerAndUnmask
(
throwToResourceManager
resourceManager
.
AsyncException
)
action
async_
::
MonadResourceManager
m
=>
(
ResourceManagerIO
()
)
->
m
()
async_
action
=
void
$
async
action
...
...
This diff is collapsed.
Click to expand it.
src/Quasar/Async/Unmanaged.hs
+
3
−
1
View file @
b1bd5497
...
...
@@ -110,7 +110,9 @@ unmanagedAsyncWithHandlerAndUnmask handler action = do
catchAll
case
result
of
Left
(
fromException
->
Just
AsyncDisposed
)
->
pure
()
Left
ex
->
handler
ex
Left
(
fromException
->
Just
(
AsyncException
ex
))
->
handler
ex
-- Impossible code path reached
Left
ex
->
traceIO
$
"Error in unmanagedAsyncWithHandlerAndUnmask: "
<>
displayException
ex
_
->
pure
()
\
ex
->
traceIO
$
"An exception was thrown while handling an async exception: "
<>
displayException
ex
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment