Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quasar-network
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-network
Commits
056640cc
Commit
056640cc
authored
3 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Add a type to serialize exceptions
Co-authored-by:
Jan Beinke
<
git@janbeinke.com
>
parent
5bb6a10d
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
quasar-network.cabal
+3
-1
3 additions, 1 deletion
quasar-network.cabal
src/Quasar/Network/Exception.hs
+22
-0
22 additions, 0 deletions
src/Quasar/Network/Exception.hs
with
25 additions
and
1 deletion
quasar-network.cabal
+
3
−
1
View file @
056640cc
...
...
@@ -95,6 +95,7 @@ library
exposed-modules:
Quasar.Network
Quasar.Network.Connection
Quasar.Network.Exception
Quasar.Network.Multiplexer
Quasar.Network.Runtime
Quasar.Network.Runtime.Observable
...
...
@@ -107,9 +108,10 @@ test-suite quasar-network-test
import: shared-executable-properties
type: exitcode-stdio-1.0
build-depends:
QuickCheck,
hspec,
quasar-network,
QuickCheck
stm,
main-is: Spec.hs
other-modules:
Quasar.NetworkSpec
...
...
This diff is collapsed.
Click to expand it.
src/Quasar/Network/Exception.hs
0 → 100644
+
22
−
0
View file @
056640cc
module
Quasar.Network.Exception
(
PackedException
(
..
),
packException
,
unpackException
)
where
import
Control.Exception
import
Data.Binary
(
Binary
(
..
))
import
Quasar.Prelude
data
PackedException
=
PackedAnyException
AnyException
deriving
stock
(
Show
,
Eq
,
Generic
)
deriving
anyclass
Binary
data
AnyException
=
AnyException
String
deriving
stock
(
Show
,
Eq
,
Generic
)
deriving
anyclass
(
Binary
,
Exception
)
packException
::
Exception
e
=>
e
->
PackedException
packException
ex
=
PackedAnyException
$
AnyException
$
displayException
ex
unpackException
::
PackedException
->
SomeException
unpackException
(
PackedAnyException
ex
)
=
toException
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