Update dependencies, log errors as errors.
This commit is contained in:
parent
3d2f52ee1d
commit
3b1e9b5a8d
@ -1,8 +1,8 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "JDB Software's opinionated extensions and auth layer for Jester."
|
description = "Jonathan's opinionated extensions and auth layer for Jester."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
srcDir = "src"
|
srcDir = "src"
|
||||||
|
|
||||||
@ -10,10 +10,12 @@ srcDir = "src"
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
requires "nim >= 1.6.2"
|
requires "nim >= 1.6.2"
|
||||||
|
|
||||||
|
# from standard nimble repo
|
||||||
requires @["bcrypt", "jester >= 0.5.0", "uuids"]
|
requires @["bcrypt", "jester >= 0.5.0", "uuids"]
|
||||||
|
|
||||||
requires "https://git.jdb-software.com/jdb/nim-jwt-full.git >= 0.2.0"
|
# from https://git.jdb-software.com/jdb/nim-packages
|
||||||
requires "https://git.jdb-software.com/jdb/nim-namespaced-logging.git >= 0.3.0"
|
requires @["jwt_full >= 0.2.0", "namespaced_logging >= 0.3.0"]
|
||||||
|
|
||||||
task unittest, "Runs the unit test suite.":
|
task unittest, "Runs the unit test suite.":
|
||||||
exec "nim c -r test/runner"
|
exec "nim c -r test/runner"
|
||||||
|
@ -76,8 +76,8 @@ proc makeDataBody*(
|
|||||||
proc makeStatusBody*(details: string): JsonNode = %*{"details":details}
|
proc makeStatusBody*(details: string): JsonNode = %*{"details":details}
|
||||||
|
|
||||||
template sendErrorResp*(err: ref ApiError, knownOrigins: seq[string]): void =
|
template sendErrorResp*(err: ref ApiError, knownOrigins: seq[string]): void =
|
||||||
log().debug err.respMsg & ( if err.msg.len > 0: ": " & err.msg else: "")
|
log().error err.respMsg & ( if err.msg.len > 0: ": " & err.msg else: "")
|
||||||
if not err.parent.isNil: log().debug " original exception: " & err.parent.msg
|
if not err.parent.isNil: log().error " original exception: " & err.parent.msg
|
||||||
sendJsonResp(makeStatusBody(err.respMsg), err.respCode, knownOrigins, @{:})
|
sendJsonResp(makeStatusBody(err.respMsg), err.respCode, knownOrigins, @{:})
|
||||||
|
|
||||||
## CORS support
|
## CORS support
|
||||||
|
Loading…
x
Reference in New Issue
Block a user