Skip to content

Commit

Permalink
refactor(rpc): add [Call.to_dyn] (#6790)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg authored Dec 28, 2022
1 parent 8bc998b commit c80fa7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions otherlibs/dune-rpc/private/dune_rpc_private.mli
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ module Version_error : sig

val message : t -> string

val to_dyn : t -> Dyn.t

exception E of t
end

Expand Down
6 changes: 6 additions & 0 deletions otherlibs/dune-rpc/private/versioned.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ module Version_error = struct

let message t = t.message

let to_dyn { payload; message } =
Dyn.record
[ ("message", Dyn.string message)
; ("payload", Dyn.(option Sexp.to_dyn) payload)
]

let create ?payload ~message () = { payload; message }

exception E of t
Expand Down
2 changes: 2 additions & 0 deletions otherlibs/dune-rpc/private/versioned.mli
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module Version_error : sig

val message : t -> string

val to_dyn : t -> Dyn.t

exception E of t
end

Expand Down

0 comments on commit c80fa7c

Please sign in to comment.