mirror of
https://github.com/logos-storage/nim-chronos.git
synced 2026-01-08 00:13:08 +00:00
Fix #16.
This commit is contained in:
parent
7d63a1b54d
commit
4290e06e77
@ -1,5 +1,5 @@
|
||||
packageName = "chronos"
|
||||
version = "2.2.2"
|
||||
version = "2.2.3"
|
||||
author = "Status Research & Development GmbH"
|
||||
description = "Chronos"
|
||||
license = "Apache License 2.0 or MIT"
|
||||
|
||||
@ -29,7 +29,6 @@ type
|
||||
finished: bool
|
||||
error*: ref Exception ## Stored exception
|
||||
errorStackTrace*: StackTrace
|
||||
when not defined(release):
|
||||
stackTrace: StackTrace ## For debugging purposes only.
|
||||
id: int
|
||||
fromProc: string
|
||||
@ -46,7 +45,6 @@ type
|
||||
FutureError* = object of Exception
|
||||
cause*: FutureBase
|
||||
|
||||
when not defined(release):
|
||||
var currentID* {.threadvar.}: int
|
||||
currentID = 0
|
||||
|
||||
@ -69,7 +67,6 @@ proc callSoon*(c: CallbackFunc, u: pointer = nil) =
|
||||
template setupFutureBase(fromProc: string) =
|
||||
new(result)
|
||||
result.finished = false
|
||||
when not defined(release):
|
||||
result.stackTrace = getStackTrace()
|
||||
result.id = currentID
|
||||
result.fromProc = fromProc
|
||||
@ -103,7 +100,6 @@ proc clean*[T](future: FutureVar[T]) =
|
||||
proc checkFinished[T](future: Future[T]) =
|
||||
## Checks whether `future` is finished. If it is then raises a
|
||||
## ``FutureError``.
|
||||
when not defined(release):
|
||||
if future.finished:
|
||||
var msg = ""
|
||||
msg.add("An attempt was made to complete a Future more than once. ")
|
||||
@ -286,7 +282,6 @@ proc `$`*(entries: seq[StackTraceEntry]): string =
|
||||
result.add(spaces(indent+2) & "## " & hint & "\n")
|
||||
|
||||
proc injectStacktrace[T](future: Future[T]) =
|
||||
when not defined(release):
|
||||
const header = "\nAsync traceback:\n"
|
||||
|
||||
var exceptionMsg = future.error.msg
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user