Browse Source

* ExtractErrorMsg

michael 4 years ago
parent
commit
f2cdddebcd
1 changed files with 11 additions and 0 deletions
  1. 11 0
      packages/dataabstract/rosdk.pas

+ 11 - 0
packages/dataabstract/rosdk.pas

@@ -212,7 +212,18 @@ Type
     function encodeInt(data : NativeInt; bits : Integer; Signed : boolean) : String;
   end;
 
+Function ExtractErrorMsg(jsError : TJSError) : String;
+
 implementation
 
+Function ExtractErrorMsg(jsError : TJSError) : String;
+begin
+  if Assigned(jsError) and isString(jsError.message) then
+    Result:=jsError.message
+  else
+    Result:='Unknown error'
+end;
+
+
 end.