@@ -28,7 +28,7 @@ let resolve_project_name ~client ~api ~project_id ~project_name =
2828 | (None, Some name ) -> (
2929 Cs_api_core. build_list_projects_request ~api
3030 |> Cs_api_io. send_request ~client
31- >> = Cs_api_io. get_response
31+ >> = Cs_api_io. get_response_graphql
3232 >> = fun body ->
3333 let projects = Cs_api_core. parse_list_projects_response ~body in
3434 match CCList.Assoc. get ~eq: String. equal name projects with
@@ -51,7 +51,7 @@ let upload_trace
5151 >> = fun project_id ->
5252 Cs_api_core. build_s3_signed_post_request ~api
5353 |> Cs_api_io. send_request ~client
54- >> = Cs_api_io. get_response
54+ >> = Cs_api_io. get_response_graphql
5555 >> = (fun body ->
5656 match Cs_api_core. parse_s3_signature_request ~body with
5757 | None ->
@@ -71,13 +71,14 @@ let upload_trace
7171 in
7272 Lwt. return (Ok import_request))
7373 >> = Cs_api_io. send_request ~client
74- >> = Cs_api_io. get_response
75- > |= fun _ -> Printf. printf " Trace uploaded\n " )
74+ >> = Cs_api_io. get_response_graphql)
7675 > |= function
77- | Ok _ as ok -> ok
76+ | Ok _ ->
77+ Printf. printf " Trace uploaded\n " ;
78+ 0
7879 | Error message ->
7980 Printf. printf " %s\n " message;
80- Error ()
81+ 1
8182
8283let trace_file =
8384 let doc = " Path to the file containing the trace" in
@@ -188,4 +189,5 @@ let default_info = Cmdliner.Term.info "cs-api" ~version:"%%VERSION_NUM%%"
188189let default_cmd = (default_term, default_info)
189190
190191let () =
191- Cmdliner.Term. eval_choice default_cmd [upload_trace_cmd] |> Cmdliner.Term. exit
192+ Cmdliner.Term. eval_choice default_cmd [upload_trace_cmd]
193+ |> Cmdliner.Term. exit_status
0 commit comments