@cubicweb/client
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -135,8 +135,13 @@ "use strict"; | ||
})); | ||
const resultSets = yield nonNullFetchApi(this._transactionApiUrl, { | ||
method: "POST", | ||
credentials: "include", | ||
body: JSON.stringify(data), | ||
}); | ||
return new Transaction_1.TransactionResult(resultSets); | ||
try { | ||
const resultSets = yield nonNullFetchApi(this._transactionApiUrl, { | ||
method: "POST", | ||
credentials: "include", | ||
body: JSON.stringify(data), | ||
}); | ||
return new Transaction_1.TransactionResult(resultSets); | ||
} | ||
catch (e) { | ||
this.handleUserErrors(e); | ||
} | ||
}); | ||
@@ -143,0 +148,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"author": "Logilab", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"license": "LGPL-3.0-or-later", | ||
@@ -8,0 +8,0 @@ "main": "lib/index.js", |
@@ -185,11 +185,15 @@ import { ValidationError } from "../Errors"; | ||
})); | ||
const resultSets = await nonNullFetchApi<ReadonlyArray<ResultSet>>( | ||
this._transactionApiUrl, | ||
{ | ||
method: "POST", | ||
credentials: "include", | ||
body: JSON.stringify(data), | ||
} | ||
); | ||
return new TransactionResult(resultSets); | ||
try { | ||
const resultSets = await nonNullFetchApi<ReadonlyArray<ResultSet>>( | ||
this._transactionApiUrl, | ||
{ | ||
method: "POST", | ||
credentials: "include", | ||
body: JSON.stringify(data), | ||
} | ||
); | ||
return new TransactionResult(resultSets); | ||
} catch (e) { | ||
this.handleUserErrors(e); | ||
} | ||
} | ||
@@ -196,0 +200,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
134440
2713