Skip to content

Commit

Permalink
Feature: Expand error codes (#545)
Browse files Browse the repository at this point in the history
* WC-4057: Added more modbus error codes to the table.

* index.js: Tweak undefined error code 9

To be consistent with the similarly undefined error code 0.

* index.js: Drop inline index number comments on errors table.

```
     Error: Code did not pass lint rulesindex.js: line 38, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 39, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 40, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 41, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 42, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 43, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 44, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 45, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 46, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 47, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 48, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)
index.js: line 49, col 5, Error - Expected space or tab after '/*' in comment. (spaced-comment)

12 problems
      at Context.<anonymous> (node_modules/mocha-eslint/index.js:38:15)
      at processImmediate (node:internal/timers:466:21)
```

Sorry @SamuelToh, those comments have got to go:

---------

Co-authored-by: SamuelToh <[email protected]>
  • Loading branch information
sjlongland and SamuelToh authored Feb 8, 2024
1 parent 6be368c commit 5357659
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ const modbusErrorMessages = [
"Illegal data value (value cannot be written to this register)",
"Slave device failure (device reports internal error)",
"Acknowledge (requested data will be available later)",
"Slave device busy (retry request again later)"
"Slave device busy (retry request again later)",
"Negative acknowledge (slave device cannot perform programming functions)",
"Memory parity error (slave device detected a parity error in memory)",
"Unknown error",
"Gateway path unavailable (misconfigured gateway)",
"Gateway target device failed to respond (retry request again later)"
];

const PortNotOpenError = function() {
Expand Down

0 comments on commit 5357659

Please sign in to comment.