@0xflair/common
Advanced tools
Comparing version 0.36.1 to 0.37.0
@@ -27,23 +27,30 @@ var Environment; | ||
var error = input.error || input; | ||
var result; | ||
if (error) { | ||
if (error.data && error.data.message) { | ||
return error.data.message; | ||
result = error.data.message; | ||
} | ||
else if (error.error && error.error.message) { | ||
return error.error.message; | ||
result = error.error.message; | ||
} | ||
else if (error.reason) { | ||
return error.reason; | ||
result = error.reason; | ||
} | ||
else if (error.name) { | ||
return translateErrorName(error); | ||
result = translateErrorName(error); | ||
} | ||
else if (error.message) { | ||
return error.message; | ||
result = error.message; | ||
} | ||
else { | ||
return error.toString(); | ||
result = error.toString(); | ||
} | ||
} | ||
return input.toString(); | ||
else { | ||
result = input.toString(); | ||
} | ||
if (result.includes('transaction underpriced')) { | ||
result = 'You must use higher gas price. Transaction is underpriced.'; | ||
} | ||
return result; | ||
} | ||
@@ -50,0 +57,0 @@ function translateContractError(message) { |
@@ -31,23 +31,30 @@ 'use strict'; | ||
var error = input.error || input; | ||
var result; | ||
if (error) { | ||
if (error.data && error.data.message) { | ||
return error.data.message; | ||
result = error.data.message; | ||
} | ||
else if (error.error && error.error.message) { | ||
return error.error.message; | ||
result = error.error.message; | ||
} | ||
else if (error.reason) { | ||
return error.reason; | ||
result = error.reason; | ||
} | ||
else if (error.name) { | ||
return translateErrorName(error); | ||
result = translateErrorName(error); | ||
} | ||
else if (error.message) { | ||
return error.message; | ||
result = error.message; | ||
} | ||
else { | ||
return error.toString(); | ||
result = error.toString(); | ||
} | ||
} | ||
return input.toString(); | ||
else { | ||
result = input.toString(); | ||
} | ||
if (result.includes('transaction underpriced')) { | ||
result = 'You must use higher gas price. Transaction is underpriced.'; | ||
} | ||
return result; | ||
} | ||
@@ -54,0 +61,0 @@ function translateContractError(message) { |
{ | ||
"name": "@0xflair/common", | ||
"version": "0.36.1", | ||
"version": "0.37.0", | ||
"private": false, | ||
@@ -22,3 +22,3 @@ "repository": { | ||
], | ||
"gitHead": "775b779bbf8fd1e2d985c324799eeedfb67b28e6" | ||
"gitHead": "3923fff6ee99ea890ff8cfab980ca2115bf57999" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49154
152