Skip to content

Commit

Permalink
engine: more informative error log
Browse files Browse the repository at this point in the history
  • Loading branch information
pveber committed Jan 4, 2019
1 parent 8016027 commit 40a5ec8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/engine/execution_trace.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ let error_report trace db buf =
match trace with
| Run { outcome ; _ } ->
if not (Task_result.succeeded outcome) then
let tid = Task_result.id outcome in
let title = sprintf "Task %s failed\n" tid in
let title = sprintf "Task %s failed\n" (Task_result.name outcome) in
let short_descr = Task_result.error_short_descr outcome in
error_title buf title short_descr ;
Task_result.error_long_descr outcome db buf tid
Task_result.error_long_descr outcome db buf (Task_result.id outcome)
| Allocation_error { id ; msg } ->
let title = sprintf "Task %s failed\n" id in
let short_descr = sprintf "Allocation error: %s\n" msg in
Expand Down
8 changes: 8 additions & 0 deletions lib/engine/task_result.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ let id = function
| Plugin { id ; _ }
| Container_image_fetch { id ; _ } -> id

let name = function
| Input { id ; path ; _ } -> sprintf "input(%s, %s)" id path
| Select { dir_path ; sel ; _ } ->
sprintf "select(%s, %s)" dir_path (Path.to_string sel)
| Shell { id ; descr ; _ } -> sprintf "shell(%s,%s)" descr id
| Plugin { id ; descr ; _ } -> sprintf "plugin(%s,%s)" descr id
| Container_image_fetch { id ; _ } -> sprintf "container_image_fetch(%s)" id

let succeeded_of_outcome = function
| `Succeeded -> true
| `Failed | `Missing_output -> false
Expand Down
2 changes: 2 additions & 0 deletions lib/engine/task_result.mli
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type t =

val id : t -> string

val name : t -> string

val succeeded : t -> bool

val error_short_descr : t -> string
Expand Down

0 comments on commit 40a5ec8

Please sign in to comment.