@polywrap/core-js
Advanced tools
Comparing version 0.9.5 to 0.9.6
@@ -64,2 +64,3 @@ import { CleanResolutionStep } from "../algorithms"; | ||
toString(): string; | ||
private static sanitizeUnwrappedRustResult; | ||
private static _parse; | ||
@@ -66,0 +67,0 @@ private static stringify; |
@@ -81,2 +81,3 @@ "use strict"; | ||
WrapError.parse = function (error) { | ||
error = WrapError.sanitizeUnwrappedRustResult(error); | ||
var delim = "\n\nAnother exception was encountered during execution:\n"; | ||
@@ -106,2 +107,10 @@ var errorStrings = error.split(delim); | ||
}; | ||
// remove escape characters that may have been added by Rust | ||
WrapError.sanitizeUnwrappedRustResult = function (error) { | ||
if (error.startsWith('__wrap_abort: called `Result::unwrap()` on an `Err` value: "')) { | ||
error = error.replace(/\\"/g, '"'); | ||
error = error.replace(/\\n/g, "\n"); | ||
} | ||
return error; | ||
}; | ||
// parse a single WrapError, where the 'prev' property is undefined | ||
@@ -196,3 +205,3 @@ WrapError._parse = function (error) { | ||
WrapError.re = new RegExp([ | ||
/^(?:[A-Za-z_: ]*; )?WrapError: (?<reason>(?:.|\r|\n)*)/.source, | ||
/^(?:[A-Za-z_:()` ]*;? "?)?WrapError: (?<reason>(?:.|\r|\n)*)/.source, | ||
// there is some padding added to the number of words expected in an error code | ||
@@ -209,4 +218,5 @@ /(?:\r\n|\r|\n)code: (?<code>1?[0-9]{1,2}|2[0-4][0-9]|25[0-5]) (?:[A-Z]+ ?){1,5}/ | ||
.source, | ||
/(?:(?:\r\n|\r|\n){2}This exception was caused by the following exception:(?:\r\n|\r|\n)(?<cause>(?:.|\r|\n)+))?$/ | ||
/(?:(?:\r\n|\r|\n){2}This exception was caused by the following exception:(?:\r\n|\r|\n)(?<cause>(?:.|\r|\n)+))?/ | ||
.source, | ||
/"?$/.source, | ||
].join("")); | ||
@@ -213,0 +223,0 @@ return WrapError; |
{ | ||
"name": "@polywrap/core-js", | ||
"description": "Polywrap Javascript Core", | ||
"version": "0.9.5", | ||
"version": "0.9.6", | ||
"license": "MIT", | ||
@@ -22,7 +22,7 @@ "repository": { | ||
"dependencies": { | ||
"@polywrap/asyncify-js": "0.9.5", | ||
"@polywrap/msgpack-js": "0.9.5", | ||
"@polywrap/result": "0.9.5", | ||
"@polywrap/tracing-js": "0.9.5", | ||
"@polywrap/wrap-manifest-types-js": "0.9.5", | ||
"@polywrap/asyncify-js": "0.9.6", | ||
"@polywrap/msgpack-js": "0.9.6", | ||
"@polywrap/result": "0.9.6", | ||
"@polywrap/tracing-js": "0.9.6", | ||
"@polywrap/wrap-manifest-types-js": "0.9.6", | ||
"graphql": "15.5.0", | ||
@@ -35,3 +35,3 @@ "graphql-tag": "2.10.4", | ||
"devDependencies": { | ||
"@polywrap/os-js": "0.9.5", | ||
"@polywrap/os-js": "0.9.6", | ||
"@types/jest": "26.0.8", | ||
@@ -38,0 +38,0 @@ "@types/mustache": "4.0.1", |
Sorry, the diff of this file is not supported yet
143297
2345
+ Added@polywrap/asyncify-js@0.9.6(transitive)
+ Added@polywrap/msgpack-js@0.9.6(transitive)
+ Added@polywrap/result@0.9.6(transitive)
+ Added@polywrap/tracing-js@0.9.6(transitive)
+ Added@polywrap/wrap-manifest-types-js@0.9.6(transitive)
- Removed@polywrap/asyncify-js@0.9.5(transitive)
- Removed@polywrap/msgpack-js@0.9.5(transitive)
- Removed@polywrap/result@0.9.5(transitive)
- Removed@polywrap/tracing-js@0.9.5(transitive)
- Removed@polywrap/wrap-manifest-types-js@0.9.5(transitive)
Updated@polywrap/asyncify-js@0.9.6
Updated@polywrap/msgpack-js@0.9.6
Updated@polywrap/result@0.9.6
Updated@polywrap/tracing-js@0.9.6