Skip to content

Commit

Permalink
parser: handle non-json result
Browse files Browse the repository at this point in the history
  • Loading branch information
bit0r1n committed Aug 26, 2024
1 parent fd54700 commit 056b3a5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion parser/src/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ router parserRouter:
$(%*{ "error": "Failed to parse week" }),
"application/json; charset=utf-8"
)
error ScheduleServiceError:
resp(
Http500,
$(%*{ "error": "Schedule service returned an unexpected result" }),
"application/json; charset=utf-8"
)
error Http404:
resp(
Http404,
Expand All @@ -121,7 +127,7 @@ router parserRouter:
proc main() {.async.} =
mitsoParser = newScheduleSite()
echo "Loading groups..."
fetchedGroups = await mitsoParser.loadGroups()
fetchedGroups = await mitsoParser.loadGroups()

let s = newSettings(
Port(3000)
Expand Down

0 comments on commit 056b3a5

Please sign in to comment.