Skip to content

Commit 639a634

Browse files
committed
CA-409628: remove unnecessary log_backtrace from API boundary
We should only log_backtrace if we are the final handler. The exception is raised here, so the caller will have a chance to log it. This was also inconsistent: some *_interface logged the backtrace, and others didn't. In theory there is a chance that the caller is buggy and doesn't log the correct backtrace. But if we simplify the places that call the Backtrace module, we'll have fewer chances of that going wrong. Signed-off-by: Edwin Török <[email protected]>
1 parent d5c00db commit 639a634

File tree

4 files changed

+0
-4
lines changed

4 files changed

+0
-4
lines changed

ocaml/xapi-idl/gpumon/gpumon_interface.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ let gpu_err =
8888
; raiser=
8989
(fun e ->
9090
let exn = Gpumon_error e in
91-
log_backtrace exn ;
9291
error "%s (%s)" (Printexc.to_string exn) __LOC__ ;
9392
raise exn
9493
)

ocaml/xapi-idl/memory/memory_interface.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ let err =
8888
; raiser=
8989
(fun e ->
9090
let exn = MemoryError e in
91-
log_backtrace exn ;
9291
error "%s (%s)" (Printexc.to_string exn) __LOC__ ;
9392
raise exn
9493
)

ocaml/xapi-idl/network/network_interface.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ let err =
295295
; raiser=
296296
(fun e ->
297297
let exn = Network_error e in
298-
log_backtrace exn ;
299298
error "%s (%s)" (Printexc.to_string exn) __LOC__ ;
300299
raise exn
301300
)

ocaml/xapi-idl/v6/v6_interface.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ let err =
112112
; raiser=
113113
(fun e ->
114114
let exn = V6_error e in
115-
log_backtrace exn ;
116115
error "%s (%s)" (Printexc.to_string exn) __LOC__ ;
117116
raise exn
118117
)

0 commit comments

Comments
 (0)