Skip to content

Commit bb4bc1a

Browse files
committed
Update: Err.ExpandErrorRecord functions
1 parent ee61b0a commit bb4bc1a

2 files changed

Lines changed: 19 additions & 16 deletions

File tree

source/Errors/Err.ExpandErrorRecord.Verbose.pq

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ let
77
Err.ExpandErrorRecord.Verbose.pq - when you want an excessive amount of details
88
*/
99
// when you want extra details on an exception, mainly for interactive use.
10-
Err.ExpandErrorRecord.Verbose = (exception as any, optional options as nullable record) => [
10+
Err.ExpandErrorRecord.Verbose = (
11+
exception as any,
12+
optional options as nullable record
13+
) => [
14+
1115
// options = Record.Combine({
1216
// defaults,
1317
// (options ?? []) // does this cause the unexpectStete of object

source/Errors/Err.ExpandErrorRecord.pq

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ let
77
Err.ExpandErrorRecord.Verbose.pq - when you want an excessive amount of details
88
*/
99
// when you want extra details on an exception, mainly for interactive use.
10-
Err.ExpandErrorRecord = (exception as any, optional options as nullable record) => [
10+
Err.ExpandErrorRecord = (
11+
exception as any,
12+
optional options as nullable record
13+
) => [
14+
Json = (source as any) as text => Text.FromBinary( Json.FromValue( source ) ),
1115
return = [
1216
// Er_Type = Value.Type( exception ), // is alway a record?
1317
Err = exception,
@@ -21,20 +25,15 @@ let
2125
Message.Format = Err[Message.Format]? ?? null,
2226
Message.Parameters = Err[Message.Parameters]? ?? null,
2327

24-
Expression.Stack = Err.Meta[Expression.Stack]? ?? null,
25-
Stack_Json_Oneline = Json( Expression.Stack ),
26-
Stack_Json_List = List.Transform(
27-
Expression.Stack,
28-
(item) =>
29-
Json( item )
30-
),
31-
Stack_Json_List_Str = Text.Combine( Stack_Json_List, "#(cr,lf)"),
32-
Stack_JsonAbbr_List_Str = Text.Combine( Stack_JsonAbbr_List_Simple, "#(cr,lf)"),
33-
34-
Stack_JsonAbbr_List_Simple = List.Transform(
35-
Stack_Json_List,
36-
(item) => Json.Abbr( item )
37-
),
28+
Expression.Stack = Err.Meta[Expression.Stack]? ?? null,
29+
Expression.Stack.Json = Json( Expression.Stack ),
30+
Expression.Stack.JsonLines =
31+
Text.Combine(
32+
List.Transform(
33+
Expression.Stack,
34+
(item) => Json( item )
35+
),
36+
"#(cr,lf)" ),
3837

3938
ActivityId = Diagnostics.ActivityId(),
4039
ModuleVersion = Module.Versions()

0 commit comments

Comments
 (0)