<!-- SPDX-FileCopyrightText: Copyright 2023 Jetperch LLC
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->

<a id="h-error-code"></a>

# Error codes

### *group* Error codes

Standardize error code definitions. 

See [errc](http://www.cplusplus.com/reference/system_error/errc/)

### Defines

### JSDRV_SUCCESS

A shorter, less confusing alias for success. 

### Enums

### enum jsdrv_error_code_e

The list of error codes. 

*Values:*

### enumerator JSDRV_ERROR_SUCCESS

Success (no error). 

### enumerator JSDRV_ERROR_UNSPECIFIED

Unspecified error. 

### enumerator JSDRV_ERROR_NOT_ENOUGH_MEMORY

Insufficient memory to complete the operation. 

### enumerator JSDRV_ERROR_NOT_SUPPORTED

Operation is not supported. 

### enumerator JSDRV_ERROR_IO

Input/output error. 

### enumerator JSDRV_ERROR_PARAMETER_INVALID

The parameter value is invalid. 

### enumerator JSDRV_ERROR_INVALID_RETURN_CONDITION

The function return condition is invalid. 

### enumerator JSDRV_ERROR_INVALID_CONTEXT

The context is invalid. 

### enumerator JSDRV_ERROR_INVALID_MESSAGE_LENGTH

The message length is invalid. 

### enumerator JSDRV_ERROR_MESSAGE_INTEGRITY

The message integrity check failed. 

### enumerator JSDRV_ERROR_SYNTAX_ERROR

A syntax error was detected. 

### enumerator JSDRV_ERROR_TIMED_OUT

The operation did not complete in time. 

### enumerator JSDRV_ERROR_FULL

The target of the operation is full. 

### enumerator JSDRV_ERROR_EMPTY

The target of the operation is empty. 

### enumerator JSDRV_ERROR_TOO_SMALL

The target of the operation is too small. 

### enumerator JSDRV_ERROR_TOO_BIG

The target of the operation is too big. 

### enumerator JSDRV_ERROR_NOT_FOUND

The requested resource was not found. 

### enumerator JSDRV_ERROR_ALREADY_EXISTS

The requested resource already exists. 

### enumerator JSDRV_ERROR_PERMISSIONS

Insufficient permissions to perform the operation. 

### enumerator JSDRV_ERROR_BUSY

The requested resource is currently busy. 

### enumerator JSDRV_ERROR_UNAVAILABLE

The requested resource is currently unavailable. 

### enumerator JSDRV_ERROR_IN_USE

The requested resource is currently in use. 

### enumerator JSDRV_ERROR_CLOSED

The requested resource is currently closed. 

### enumerator JSDRV_ERROR_SEQUENCE

The requested operation was out of sequence. 

### enumerator JSDRV_ERROR_ABORTED

The requested operation was previously aborted. 

### enumerator JSDRV_ERROR_SYNCHRONIZATION

The target is not synchronized with the originator. 

### Functions

### const char \*jsdrv_error_code_name(int32_t ec)

Convert an error code into its short name. 

* **Parameters:**
  **ec** – **[in]** The error code ([jsdrv_error_code_e](#group__jsdrv__ec_1ga4bb10d6ebaa503f491a70539b49df124)). 
* **Returns:**
  The short string name for the error code. 

### const char \*jsdrv_error_code_description(int32_t ec)

Convert an error code into its description. 

* **Parameters:**
  **ec** – **[in]** The error code ([jsdrv_error_code_e](#group__jsdrv__ec_1ga4bb10d6ebaa503f491a70539b49df124)). 
* **Returns:**
  The user-meaningful description of the error.
