Skip to content

Commit b6d0397

Browse files
Decompose error in any namespace fix
1 parent 331fa1c commit b6d0397

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"printableName": "Cache Web Terminal",
66
"description": "Web-based terminal emulator for Caché administering.",
77
"author": "ZitRo",
8-
"version": "4.2.5",
8+
"version": "4.2.6",
99
"gaID": "UA-83005064-2",
1010
"releaseNumber": 26,
1111
"scripts": {

src/cls/WebTerminal/ErrorDecomposer.cls

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ Parameter LINES As %Numeric = 5;
55

66
/// Takes $ZERROR function result.
77
/// Returns either simple string or %ZEN.proxyObject representing the error details.
8-
ClassMethod DecomposeError (err As %String = "")
8+
ClassMethod DecomposeError (err As %String = "", ns As %String = "")
99
{
10+
new $namespace
11+
if (ns '= "") {
12+
try {
13+
set $namespace = ns
14+
} catch (e) {
15+
return err
16+
}
17+
}
1018
return:($FIND(err, "<") '= 2) err
1119
set startPos = $FIND(err, ">")
1220
return:(startPos = 0) err

src/cls/WebTerminal/Handlers.cls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ loop
6565
set client.childNamespace = $LISTGET(chunk, 1)
6666
set err = $LISTGET(chunk, 2)
6767
if (err '= "") {
68-
do client.Send("execError", ##class(ErrorDecomposer).DecomposeError(err))
68+
do client.Send(
69+
"execError",
70+
##class(ErrorDecomposer).DecomposeError(err, client.childNamespace)
71+
)
6972
}
7073
quit // break for cycle
7174
} else { // unknown response - just send it to the client

0 commit comments

Comments
 (0)