Merge ../Nim into devel
This commit is contained in:
commit
2cc5bc0db3
4 changed files with 21 additions and 4 deletions
|
|
@ -720,7 +720,10 @@ type
|
||||||
proc handleError(msg: TMsgKind, eh: TErrorHandling, s: string) =
|
proc handleError(msg: TMsgKind, eh: TErrorHandling, s: string) =
|
||||||
template quit =
|
template quit =
|
||||||
if defined(debug) or gVerbosity >= 3 or msg == errInternal:
|
if defined(debug) or gVerbosity >= 3 or msg == errInternal:
|
||||||
writeStackTrace()
|
if stackTraceAvailable():
|
||||||
|
writeStackTrace()
|
||||||
|
else:
|
||||||
|
msgWriteln("No stack traceback available\nTo create a stacktrace, rerun compilation with ./koch temp c <file>")
|
||||||
quit 1
|
quit 1
|
||||||
|
|
||||||
if msg >= fatalMin and msg <= fatalMax:
|
if msg >= fatalMin and msg <= fatalMax:
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@ type
|
||||||
TDbConn* = PMySQL ## encapsulates a database connection
|
TDbConn* = PMySQL ## encapsulates a database connection
|
||||||
TRow* = seq[string] ## a row of a dataset. NULL database values will be
|
TRow* = seq[string] ## a row of a dataset. NULL database values will be
|
||||||
## transformed always to the empty string.
|
## transformed always to the empty string.
|
||||||
EDb* = object of EIO ## exception that is raised if a database error occurs
|
EDb* = object of IOError ## exception that is raised if a database error occurs
|
||||||
|
|
||||||
TSqlQuery* = distinct string ## an SQL query string
|
TSqlQuery* = distinct string ## an SQL query string
|
||||||
|
|
||||||
FDb* = object of FIO ## effect that denotes a database operation
|
FDb* = object of IOEffect ## effect that denotes a database operation
|
||||||
FReadDb* = object of FDb ## effect that denotes a read operation
|
FReadDb* = object of FDb ## effect that denotes a read operation
|
||||||
FWriteDb* = object of FDb ## effect that denotes a write operation
|
FWriteDb* = object of FDb ## effect that denotes a write operation
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,8 @@ proc auxWriteStackTrace(f: PFrame, s: var string) =
|
||||||
add(s, tempFrames[j].procname)
|
add(s, tempFrames[j].procname)
|
||||||
add(s, "\n")
|
add(s, "\n")
|
||||||
|
|
||||||
|
proc stackTraceAvailable*(): bool
|
||||||
|
|
||||||
when hasSomeStackTrace:
|
when hasSomeStackTrace:
|
||||||
proc rawWriteStackTrace(s: var string) =
|
proc rawWriteStackTrace(s: var string) =
|
||||||
when NimStackTrace:
|
when NimStackTrace:
|
||||||
|
|
@ -188,6 +190,18 @@ when hasSomeStackTrace:
|
||||||
auxWriteStackTraceWithBacktrace(s)
|
auxWriteStackTraceWithBacktrace(s)
|
||||||
else:
|
else:
|
||||||
add(s, "No stack traceback available\n")
|
add(s, "No stack traceback available\n")
|
||||||
|
proc stackTraceAvailable(): bool =
|
||||||
|
when NimStackTrace:
|
||||||
|
if framePtr == nil:
|
||||||
|
result = false
|
||||||
|
else:
|
||||||
|
result = true
|
||||||
|
elif defined(nativeStackTrace) and nativeStackTraceSupported:
|
||||||
|
result = true
|
||||||
|
else:
|
||||||
|
result = false
|
||||||
|
else:
|
||||||
|
proc stackTraceAvailable*(): bool = result = false
|
||||||
|
|
||||||
proc quitOrDebug() {.inline.} =
|
proc quitOrDebug() {.inline.} =
|
||||||
when not defined(endb):
|
when not defined(endb):
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
when defined(Unix):
|
when defined(Unix):
|
||||||
when defined(macosx):
|
when defined(macosx):
|
||||||
const
|
const
|
||||||
lib = "libmysqlclient.(15|16|17[18).dylib"
|
lib = "libmysqlclient.(15|16|17|18).dylib"
|
||||||
else:
|
else:
|
||||||
const
|
const
|
||||||
lib = "libmysqlclient.so.(15|16|17|18)"
|
lib = "libmysqlclient.so.(15|16|17|18)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue