diff --git a/src/experimental/parser/user.nim b/src/experimental/parser/user.nim index a956aa85d..b4d710f6c 100644 --- a/src/experimental/parser/user.nim +++ b/src/experimental/parser/user.nim @@ -80,6 +80,8 @@ proc parseUser*(json: string; username=""): User = proc parseUsers*(json: string; after=""): Result[User] = result = Result[User](beginning: after.len == 0) - let raw = json.fromJson(seq[RawUser]) - for user in raw: - result.content.add user.toUser + # starting with '{' means it's an error + if json[0] == '[': + let raw = json.fromJson(seq[RawUser]) + for user in raw: + result.content.add user.toUser diff --git a/src/types.nim b/src/types.nim index 13d2f91b7..4dca5f016 100644 --- a/src/types.nim +++ b/src/types.nim @@ -45,9 +45,10 @@ type null = 0 noUserMatches = 17 protectedUser = 22 - paramsMissing = 25 + missingParams = 25 couldntAuth = 32 doesntExist = 34 + invalidParam = 47 userNotFound = 50 suspended = 63 rateLimited = 88