@@ -125,6 +125,11 @@ def _hint(self):
125
125
# not a stable API method
126
126
return self ._read_str_field (FIELD_HINT )
127
127
128
+ @property
129
+ def _details (self ):
130
+ # not a stable API method
131
+ return self ._read_str_field (FIELD_DETAILS )
132
+
128
133
def _read_str_field (self , key , default = None ):
129
134
val = self ._attrs .get (key )
130
135
if val :
@@ -156,6 +161,7 @@ def __str__(self):
156
161
self ._line if self ._line > 0 else "?" ,
157
162
self ._col if self ._col > 0 else "?" ,
158
163
self ._hint or "error" ,
164
+ self ._details ,
159
165
)
160
166
except Exception :
161
167
return "" .join (
@@ -226,7 +232,7 @@ def _severity_name(severity):
226
232
return 'PANIC'
227
233
228
234
229
- def _format_error (msg , query , start , offset , line , col , hint ):
235
+ def _format_error (msg , query , start , offset , line , col , hint , details ):
230
236
c = get_color ()
231
237
rv = io .StringIO ()
232
238
rv .write (f"{ c .BOLD } { msg } { c .ENDC } { LINESEP } " )
@@ -278,6 +284,10 @@ def _format_error(msg, query, start, offset, line, col, hint):
278
284
rv .write (f"{ c .BLUE } { '' :>{num_len }} │ "
279
285
f"{ c .FAIL } ╰─{ '─' * (size - 1 )} ^ { hint } { c .ENDC } " )
280
286
break
287
+
288
+ if detials :
289
+ rv .write (f"{ LINESEP } Details: { details } " )
290
+
281
291
return rv .getvalue ()
282
292
283
293
0 commit comments