Skip to content

Commit

Permalink
Better reporting when OCaml compiler versions don't match
Browse files Browse the repository at this point in the history
  • Loading branch information
bcpierce00 committed May 23, 2016
1 parent f216428 commit 3c581cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/RECENTNEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ CHANGES FROM VERSION 2.48.4
* Fix build for OCaml 4.03
(and add Makefile improvements for exporting under git)



* Better reporting for OCaml compiler version mismatch

-------------------------------
CHANGES FROM VERSION 2.48.1
Expand Down
7 changes: 6 additions & 1 deletion src/remote.ml
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,12 @@ let defaultMarshalingFunctions =
let s = Bytearray.marshal data [Marshal.No_sharing] in
let l = Bytearray.length s in
((s, 0, l) :: rem, l)),
(fun buf pos -> Bytearray.unmarshal buf pos)
(fun buf pos ->
try Bytearray.unmarshal buf pos
with Failure s -> raise (Util.Fatal (Printf.sprintf
"Fatal error during unmarshaling (%s),
possibly because client and server have been compiled with different\
versions of the OCaml compiler." s)))

let makeMarshalingFunctions payloadMarshalingFunctions string =
let (marshalPayload, unmarshalPayload) = payloadMarshalingFunctions in
Expand Down

0 comments on commit 3c581cc

Please sign in to comment.