| 1 |
= cockpit.js: Errors |
| 2 |
cockpit.js: Errors |
| 3 |
|
| 4 |
Problem codes and messages |
| 5 |
|
| 6 |
[[cockpit-problems]] |
| 7 |
== Problem Codes |
| 8 |
|
| 9 |
Cockpit represents problems with standardized problem string codes. |
| 10 |
|
| 11 |
`+"access-denied"+`:: |
| 12 |
The user is not permitted to perform the action in question. |
| 13 |
`+"authentication-failed"+`:: |
| 14 |
User authentication failed. |
| 15 |
`+"internal-error"+`:: |
| 16 |
An unexpected internal error without further info. This should not |
| 17 |
happen during the normal course of operations. |
| 18 |
`+"no-cockpit"+`:: |
| 19 |
The system does not have a compatible version of Cockpit installed or |
| 20 |
installed properly. |
| 21 |
`+"no-session"+`:: |
| 22 |
Cockpit is not logged in. |
| 23 |
`+"not-found"+`:: |
| 24 |
Something specifically requested was not found, such as a file, |
| 25 |
executable etc. |
| 26 |
`+"terminated"+`:: |
| 27 |
Something was terminated forcibly, such as a connection, process |
| 28 |
session, etc. |
| 29 |
`+"timeout"+`:: |
| 30 |
Something timed out. |
| 31 |
`+"unknown-hostkey"+`:: |
| 32 |
The remote host had an unexpected or unknown key. |
| 33 |
`+"no-forwarding"+`:: |
| 34 |
Could not forward authentication credentials to the remote host. |
| 35 |
|
| 36 |
[[cockpit-messages]] |
| 37 |
== cockpit.message() |
| 38 |
|
| 39 |
.... |
| 40 |
message = cockpit.message(problem) |
| 41 |
message = cockpit.message(exception) |
| 42 |
.... |
| 43 |
|
| 44 |
Return a message for the `+exception+` or `+problem+` code passed as an |
| 45 |
argument. If the argument is an object with a `+"message"+` property, as |
| 46 |
is the case with most exceptions, that will be returned directly. If the |
| 47 |
argument is an object with a `+"problem"+` property, then it will be |
| 48 |
used as the problem code. An appropriate message will be returned for |
| 49 |
problem codes. |