Skip to content

Commit

Permalink
fix: 異常時のレスポンスのステータスコードを500に修正 #200
Browse files Browse the repository at this point in the history
  • Loading branch information
jiro4989 committed Feb 21, 2021
1 parent 5819ebd commit a54a942
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions websh_server/src/websh_server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ template runShellgei(code: string, base64Images: seq[string]) =
let elapsedTime = $(now() - startTime).inMilliseconds & "milsec"
echo %*{xForHeader: xFor, "time": $now(), "level": "error", "uuid": uuid, "elapsedTime": elapsedTime, "msg": msg}

resp %*{
let data = $(%*{
"status": statusSystemError,
"system_message": "System error occured.",
"stdout": "",
"stderr": "",
"images": [],
"elapsed_time": elapsedTime,
}
})
resp(Http500, data, contentType = "application/json; charset=utf-8")

router myrouter:
post "/shellgei":
Expand Down

0 comments on commit a54a942

Please sign in to comment.