Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CA-91931: Prevent spurious exceptions being raised by Event.from

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
  • Loading branch information...
commit bc0cc5a93e5fa608eca5149cc28c944d98c47208 1 parent 97d1632
@jonludlam jonludlam authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 ocaml/xapi/xapi_event.ml
View
16 ocaml/xapi/xapi_event.ml
@@ -387,16 +387,20 @@ let from ~__context ~classes ~token ~timeout =
let modevs = List.fold_left (fun acc (table, objref, mtime) ->
let serialiser = Eventgen.find_get_record table in
- let xml = serialiser ~__context ~self:objref () in
- let ev = event_of Mod ?snapshot:xml (table, objref, mtime) in
- if event_matches sub.subs ev then ev::acc else acc
+ try
+ let xml = serialiser ~__context ~self:objref () in
+ let ev = event_of Mod ?snapshot:xml (table, objref, mtime) in
+ if event_matches sub.subs ev then ev::acc else acc
+ with _ -> acc
) delevs mods in
let createevs = List.fold_left (fun acc (table, objref, ctime) ->
let serialiser = Eventgen.find_get_record table in
- let xml = serialiser ~__context ~self:objref () in
- let ev = event_of Add ?snapshot:xml (table, objref, ctime) in
- if event_matches sub.subs ev then ev::acc else acc
+ try
+ let xml = serialiser ~__context ~self:objref () in
+ let ev = event_of Add ?snapshot:xml (table, objref, ctime) in
+ if event_matches sub.subs ev then ev::acc else acc
+ with _ -> acc
) modevs creates in
let message_events = List.fold_left (fun acc mev ->
Please sign in to comment.
Something went wrong with that request. Please try again.