This commit is contained in:
cheatfate 2019-03-29 11:53:24 +02:00
parent 7d63a1b54d
commit 4290e06e77
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
2 changed files with 42 additions and 47 deletions

View File

@ -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"

View File

@ -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