mirror of
https://github.com/zedeus/nitter
synced 2026-10-26 20:53:25 +00:00
Simplify new error handling
This commit is contained in:
parent
3d91ae0256
commit
fff04de24b
4 changed files with 12 additions and 7 deletions
|
|
@ -18,5 +18,5 @@ proc getImageUrl*(url: string): string =
|
|||
|
||||
template handleErrors*(body) =
|
||||
if json.startsWith("{\"errors"):
|
||||
let error {.inject.} = json.fromJson(Errors).errors[0].code
|
||||
body
|
||||
for error {.inject.} in json.fromJson(Errors).errors:
|
||||
body
|
||||
|
|
|
|||
Loading…
Reference in a new issue