Socket
Socket
Sign inDemoInstall

camunda-external-task-client-js

Package Overview
Dependencies
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

camunda-external-task-client-js - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0-alpha1

.idea/prettier.xml

16

docs/Client.md

@@ -137,2 +137,16 @@ # `Client`

* `client.on("lock:success", function(task) {})`
* `client.on("lock:error", function(task, error) {})`
* `client.on("lock:error", function(task, error) {})`
### Error
The error object exposes the response body of the REST API request and has the following properties:
| Property | Description | Type |
|----------------|------------------------------------------------------------------------------------------------------------------------------------|--------|
| message | A summary of the error, e.g., `Response code 400 (Bad Request); Error: my engine error; Type: ProcessEngineException; Code: 33333` | string |
| httpStatusCode | The HTTP status code returned by the REST API, e.g., `400` | number |
| engineMsg | The engine error message, e.g., `my engine error` | string |
| type | The class name of the exception, e.g., `ProcessEngineException` | string |
| code | A numeric exception error code, e.g., `33333`. | number |
You can find more information about the exception error code feature in the [Camunda Platform 7 Documentation](https://docs.camunda.org/manual/latest/user-guide/process-engine/error-handling/#exception-codes).

2

docs/Variables.md
# Variables
```js
const { Variables } = require("camunda-external-task-handler-js");
const { Variables } = require("camunda-external-task-client-js");

@@ -5,0 +5,0 @@ // ... somewhere in the handler function

@@ -34,14 +34,18 @@ /*

const { response, options } = httpError;
let error, type;
if (response.body && response.body.message && response.body.type) {
error = response.body.message;
type = response.body.type;
} else {
error = response.body;
type = "undefined";
let responseBody = null;
try {
responseBody = JSON.parse(response.body);
} catch (e) {
responseBody = response.body;
}
const { message, type, code } = responseBody;
super(
`Response code ${response.statusCode} (${response.statusMessage}); Error: ${error}; Type: ${type}`,
`Response code ${response.statusCode} (${
response.statusMessage
}); Error: ${
message ? message : responseBody
}; Type: ${type}; Code: ${code}`,
{},

@@ -52,5 +56,18 @@ options

Object.defineProperty(this, "response", {
enumerable: false,
value: response
Object.defineProperties(this, {
response: {
value: response
},
httpStatusCode: {
value: response.statusCode
},
code: {
value: code
},
type: {
value: type
},
engineMsg: {
value: message
}
});

@@ -57,0 +74,0 @@ }

@@ -26,3 +26,7 @@ /*

{
body: { type: "SomeExceptionClass", message: "a detailed message" },
body: {
type: "SomeExceptionClass",
message: "a detailed message",
code: 33333
},
statusCode: 400,

@@ -34,3 +38,3 @@ statusMessage: "Bad request"

const expectedPayload =
"Response code 400 (Bad request); Error: a detailed message; Type: SomeExceptionClass";
"Response code 400 (Bad request); Error: a detailed message; Type: SomeExceptionClass; Code: 33333";

@@ -42,2 +46,6 @@ //when

expect(engineError.message).toEqual(expectedPayload);
expect(engineError.engineMsg).toEqual("a detailed message");
expect(engineError.code).toEqual(33333);
expect(engineError.type).toEqual("SomeExceptionClass");
expect(engineError.httpStatusCode).toEqual(400);
});

@@ -56,3 +64,3 @@

const expectedPayload =
"Response code 400 (Bad request); Error: Some unexpected error message; Type: undefined";
"Response code 400 (Bad request); Error: Some unexpected error message; Type: undefined; Code: undefined";

@@ -63,4 +71,7 @@ //when

//then
expect(engineError.httpStatusCode).toEqual(400);
expect(engineError.message).toEqual(expectedPayload);
expect(engineError.code).toBeUndefined();
expect(engineError.type).toBeUndefined();
});
});

@@ -230,3 +230,7 @@ /*

{
body: { type: "SomeExceptionClass", message: "a detailed message" },
body: {
type: "SomeExceptionClass",
message: "a detailed message",
code: 33333
},
statusCode: 400,

@@ -233,0 +237,0 @@ statusMessage: "Bad request"

{
"version": "2.2.0",
"version": "2.3.0-alpha1",
"name": "camunda-external-task-client-js",

@@ -4,0 +4,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc