> ## Documentation Index
> Fetch the complete documentation index at: https://docs.volteras.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

## Introduction

Below are listed the error codes that the platform can return, either directly within Connect API error responses or set as fields in result objects for async operations (for example inside the command execution object).

Listed is a reference of the different places that an error can appear, and then a table of all the errors.

## Places where error codes shown

### CONNECT\_API

Inside API error responses (IE with http status error codes) when calling endpoints in the Connect API, returned in the response in the error field. The full schema is:

| Field     | Type   | Description                                           |
| --------- | ------ | ----------------------------------------------------- |
| requestId | string | ID of the request.                                    |
| timestamp | string | An ISO8601 formatted date and time of error.          |
| error     | string | Error type (see list below).                          |
| message   | string | A human-friendly short description of the error.      |
| data      | object | *Optional.* Any additional data that helps the debug. |

[View API Reference](https://docs.volteras.com/api-reference)

### VIN\_UPLOAD

When connecting a vehicle by uploading a VIN to the Connect API. As the VIN connection is completed async, you can see the results by calling the get upload results endpoint. Any errors are stored at the VIN level in the errors field of that response.

[View API Reference](https://docs.volteras.com/api-reference/vehicle-connection/bulk-vehicle-connect-vin-results)

### COMMANDS

When commands to the device fail. As the commands are completed async, you can see the results by calling the get vehicle command execution endpoints, or by listening to the command update webhook. Any errors are stored in the command's failedReason field.

[View API Reference](https://docs.volteras.com/api-reference/vehicle-command-executions/get-vehicle-command-execution)

## Table of Error Codes

export const ErrorCodesTable = () => {
  const errorCodes = [
    {
            "code": "OEM_UNKNOWN_ERROR",
            "description": "Unknown error returned from the OEM's API",
            "places": "COMMANDS",
          },
{
            "code": "OEM_TIMEOUT",
            "description": "The request timed out to the OEM's API",
            "places": "COMMANDS",
          },
{
            "code": "OEM_UNAVAILABLE",
            "description": "The OEM's API is temporarily unavailable (e.g. a 502 error)",
            "places": "COMMANDS",
          },
{
            "code": "OEM_NETWORK_ERROR",
            "description": "There was a network error when calling the OEM's API",
            "places": "COMMANDS",
          },
{
            "code": "OEM_INCORRECT_REGION",
            "description": "The action or request has failed because it is not supported in the specified region",
            "places": "COMMANDS, VIN_UPLOAD",
          },
{
            "code": "OEM_APP_REQUIRED_UPDATE",
            "description": "The OEM's app is required to be updated for this operation to be completed",
            "places": "COMMANDS",
          },
{
            "code": "OEM_USER_ACCOUNT_LOCKED",
            "description": "The device owner's account with the OEM has been locked by the OEM, and cannot be accessed until it is unlocked",
            "places": "COMMANDS",
          },
{
            "code": "OEM_OAUTH_TOKEN_EXPIRED",
            "description": "The OAuth token to access commands and data for the device has expired",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_OFFLINE",
            "description": "The device is offline and cannot be accessed",
            "places": "COMMANDS, VIN_UPLOAD",
          },
{
            "code": "OEM_VEHICLE_REMOTE_ACCESS_DISABLED",
            "description": "The device's remote access is not enabled or consent to access the vehicle needs to be granted to Volteras - see the error message on the object for details on how to address.",
            "places": "COMMANDS, VIN_UPLOAD",
          },
{
            "code": "OEM_VEHICLE_LOCATION_SHARING_DISABLED",
            "description": "The device's location sharing is not enabled, and needs to be enabled by the device owner",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_DATA_SHARING_DISABLED",
            "description": "Data sharing is disabled for this vehicle, it must be enabled in the manufacturer's app or in the vehicle, or by following steps in the accompanying error message.",
            "places": "VIN_UPLOAD",
          },
{
            "code": "FLEET_CONSENT_MISSING",
            "description": "This vehicle's fleet has not granted data-sharing consent in the manufacturer's fleet portal. Your fleet administrator needs to approve the connection there; the driver cannot resolve this from the vehicle.",
            "places": "VIN_UPLOAD",
          },
{
            "code": "OEM_AUTH_DRIVER_IS_NOT_PRIMARY_USER",
            "description": "The device owner's account is not the primary user of the device",
            "places": "COMMANDS, VIN_UPLOAD",
          },
{
            "code": "OEM_DEVICE_NOT_FOUND",
            "description": "The device could not be found within the OEM's platform",
            "places": "COMMANDS, VIN_UPLOAD",
          },
{
            "code": "OEM_VEHICLE_NOT_COMPATIBLE",
            "description": "The device is not compatible with the OEM's API. Check the error message to see if there are any remediation steps.",
            "places": "VIN_UPLOAD",
          },
{
            "code": "OEM_VEHICLE_UPDATE_REQUIRED",
            "description": "A vehicle update is required for the vehicle to be connected",
            "places": "VIN_UPLOAD",
          },
{
            "code": "OEM_COMMAND_TIMEOUT",
            "description": "The command timed out to the OEM's API",
            "places": "COMMANDS",
          },
{
            "code": "OEM_COMMAND_FAILED",
            "description": "The command failed to execute for an unknown reason",
            "places": "COMMANDS",
          },
{
            "code": "OEM_RATE_LIMITED",
            "description": "The OEM's API has returned a rate limit error",
            "places": "COMMANDS",
          },
{
            "code": "OEM_ACCOUNT_RATE_LIMITED",
            "description": "The device owner's account has been rate limited by the OEM, and is not currently available",
            "places": "COMMANDS",
          },
{
            "code": "OEM_DEVICE_RATE_LIMITED",
            "description": "The device has been rate limited by the OEM, and is not currently available",
            "places": "COMMANDS",
          },
{
            "code": "OEM_STOP_CHARGE_RATE_LIMITED",
            "description": "The stop charge command has been rate limited by the OEM, and is not currently available",
            "places": "COMMANDS",
          },
{
            "code": "OEM_COMMANDS_RATE_LIMITED",
            "description": "Device commands have been rate limited by the OEM for this device, and are not currently available",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_LOCATION_UNKNOWN",
            "description": "The vehicle's location is unknown, which is preventing the action from being performed",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_NOT_IN_AUTHORIZED_LOCATION",
            "description": "The vehicle is not in an authorized location to perform the action",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_CHARGING_NOT_FINISHED",
            "description": "The vehicle's charging is not finished",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_CHARGING_NOT_STOPPED",
            "description": "The vehicle's charging is not stopped",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_CHARGING_NOT_STARTED",
            "description": "The vehicle's charging is not started",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_CHARGING_NOT_PAUSED",
            "description": "The vehicle's charging is not paused",
            "places": "COMMANDS",
          },
{
            "code": "OEM_VEHICLE_CHARGING_REFUSED_PLAY_PROTECTION",
            "description": "Charging the vehicle is not allowed because of play protection",
            "places": "COMMANDS",
          },
{
            "code": "OEM_COMMAND_REFUSED_OTHER_SERVICE_RUNNING",
            "description": "The command failed because another command is already running on the vehicle",
            "places": "COMMANDS",
          },
{
            "code": "OEM_COMMAND_REFUSED_VEHICLE_AWAKE_IN_STAND_STILL_AND_RESTING_STATE",
            "description": "Command refused. The vehicle is in a stand still and resting state",
            "places": "COMMANDS",
          },
{
            "code": "OEM_COMMAND_REFUSED_VEHICLE_AWAKE_IN_STAND_STILL_AND_ACTIVE_STATE",
            "description": "Command refused. The vehicle is in a stand still and active state",
            "places": "COMMANDS",
          },
{
            "code": "OEM_COMMAND_REFUSED_VEHICLE_AWAKE_IN_DRIVING_OR_READY_TO_DRIVE",
            "description": "Command refused. The vehicle is in a driving or ready to drive state",
            "places": "COMMANDS",
          },
{
            "code": "OEM_COMMAND_REFUSED_VEHICLE_AWAKE_IN_DIAGNOSTICS_MODE",
            "description": "Command refused. The vehicle is in diagnostics mode",
            "places": "COMMANDS",
          },
{
            "code": "SERVER_ERROR",
            "description": "Something went wrong while processing the request, we have been alerted and are investigating the issue.",
            "places": "CONNECT_API, COMMANDS",
          },
{
            "code": "INTERNAL_RATE_LIMITED",
            "description": "Your organization has reached its rate limit for this operation. Please contact support if you need to increase your limit.",
            "places": "COMMANDS",
          },
{
            "code": "RESOURCE_NOT_FOUND",
            "description": "The resource was not found",
            "places": "CONNECT_API",
          },
{
            "code": "AUTHENTICATION_ERROR",
            "description": "Request authentication failed",
            "places": "CONNECT_API, COMMANDS",
          },
{
            "code": "DEVICE_LIMIT_REACHED",
            "description": "You have uploaded the maximum number of vehicles for your organization. Please contact us to upgrade.",
            "places": "VIN_UPLOAD, CONNECT_API",
          },
{
            "code": "NOT_PERMITTED",
            "description": "This action is not permitted",
            "places": "CONNECT_API, VIN_UPLOAD, COMMANDS",
          },
{
            "code": "REQUEST_VALIDATION_ERROR",
            "description": "The request validation failed",
            "places": "CONNECT_API",
          },
{
            "code": "VIN_UPLOAD_INVALID_FORMAT",
            "description": "One of the vehicle fields is invalid - see errors for details.",
            "places": "VIN_UPLOAD",
          },
{
            "code": "QUERY_PAGE_TOKEN_EXPIRED",
            "description": "The page token for this paginated query has expired. Please start a new query (IE without passing a page token).",
            "places": "CONNECT_API",
          },
{
            "code": "PAGINATED_QUERY_FILTER_CHANGED",
            "description": "The filter for this paginated query has changed between pages (IE, you have fetched a page of data, and then attempted to fetch a second page but with a different set of filters). Please start a new query or use the same filters as the previous page.",
            "places": "CONNECT_API",
          },
{
            "code": "PAGE_SIZE_TOO_LARGE",
            "description": "The page size for this paginated query is too large, please pass a smaller one.",
            "places": "CONNECT_API",
          },
{
            "code": "INVALID_VIN",
            "description": "The VIN is invalid",
            "places": "VIN_UPLOAD",
          },
{
            "code": "VIN_CHECK_NOT_SUPPORTED",
            "description": "The VIN check is not supported for this OEM",
            "places": "VIN_UPLOAD",
          },
{
            "code": "VEHICLE_ALREADY_ADDED_TO_ORGANIZATION",
            "description": "This vehicle has already been connected to the organization",
            "places": "VIN_UPLOAD",
          },
{
            "code": "VEHICLE_ALREADY_ADDED_CONNECTION_REQUIRED",
            "description": "You have already attempted to add this VIN to the platform, and it requires the consent flow to be completed to be connected",
            "places": "VIN_UPLOAD",
          },
{
            "code": "VEHICLE_ALREADY_ADDED_INCOMPATIBLE",
            "description": "You have already attempted to add this VIN to the platform, and it is incompatible",
            "places": "VIN_UPLOAD",
          },
{
            "code": "VEHICLE_ALREADY_ADDED_PENDING_CONNECTION",
            "description": "You have already attempted to add this VIN to the platform, and it is pending connection",
            "places": "VIN_UPLOAD",
          },
{
            "code": "VIN_UPLOAD_NOT_SUPPORTED",
            "description": "The VIN upload is not supported for this OEM",
            "places": "VIN_UPLOAD",
          },
{
            "code": "VIN_BLACKLISTED",
            "description": "The VIN is blacklisted and cannot be added to the platform",
            "places": "VIN_UPLOAD",
          },
{
            "code": "SUBJECTS_NOT_ASSIGNABLE",
            "description": "The vehicle owners for the VIN upload could not be assigned to the vehicle - please check that the users or user group IDs are correct.",
            "places": "VIN_UPLOAD",
          }
  ]
  const [search, setSearch] = useState("");
  const [sortConfig, setSortConfig] = useState({
    column: null,
    direction: "asc",
  });

  const filteredAndSorted = useMemo(() => {
    let filtered = errorCodes.filter((row) =>
      `${row.code} ${row.description} ${row.places}`
        .toLowerCase()
        .includes(search.toLowerCase())
    );

    if (sortConfig.column) {
      filtered = [...filtered].sort((a, b) => {
        const aVal = a[sortConfig.column] || "";
        const bVal = b[sortConfig.column] || "";
        if (!isNaN(Number(aVal)) && !isNaN(Number(bVal))) {
          return sortConfig.direction === "asc"
            ? Number(aVal) - Number(bVal)
            : Number(bVal) - Number(aVal);
        }
        return sortConfig.direction === "asc"
          ? String(aVal).localeCompare(String(bVal), undefined, {
              numeric: true,
            })
          : String(bVal).localeCompare(String(aVal), undefined, {
              numeric: true,
            });
      });
    }

    return filtered;
  }, [search, sortConfig]);

  const requestSort = (column) => {
    setSortConfig((prev) => {
      if (prev.column === column) {
        return { column, direction: prev.direction === "asc" ? "desc" : "asc" };
      }
      return { column, direction: "asc" };
    });
  };

  return (
    <div className="error-codes-container">
      <input
        type="text"
        className="search-box"
        placeholder="Search error codes..."
        value={search}
        onChange={(e) => setSearch(e.target.value)}
      />

      <table id="errorCodesTable">
        <thead>
          <tr>
            <th
              data-column="0"
              onClick={() => requestSort("code")}
              className={
                sortConfig.column === "code"
                  ? `sort-${sortConfig.direction}`
                  : ""
              }
            >
              Error Code
            </th>
            <th
              data-column="1"
              onClick={() => requestSort("description")}
              className={
                sortConfig.column === "description"
                  ? `sort-${sortConfig.direction}`
                  : ""
              }
            >
              Description
            </th>
            <th
              data-column="2"
              onClick={() => requestSort("places")}
              className={
                sortConfig.column === "places"
                  ? `sort-${sortConfig.direction}`
                  : ""
              }
            >
              Places Shown
            </th>
          </tr>
        </thead>
        <tbody>
          {filteredAndSorted.length === 0 ? (
            <tr className="no-results-row">
              <td colSpan={3} className="no-results">
                No error codes found matching your search
              </td>
            </tr>
          ) : (
            filteredAndSorted.map((row, idx) => (
              <tr key={idx}>
                <td>{row.code}</td>
                <td>{row.description}</td>
                <td>{row.places}</td>
              </tr>
            ))
          )}
        </tbody>
      </table>
    </div>
  );
};

<ErrorCodesTable />
