Error response guidelines



Commonalities issue: https://github.com/camaraproject/Commonalities/issues/180

UPDATE: CAMARA_common.yaml  corrections in https://github.com/camaraproject/Commonalities/pull/174 are covered below



Marking:

Big difference

Big difference

Difference



API Design Guidelines chapter 6

CAMARA_common.yaml

QoD

Device Status

Location  Verification

Error code

Description

Status  

Error code

Description

Status  

Error code

Description

Status  

Error code

Description

Status  

Error code

Description

Syntax Exceptions

INVALID_ARGUMENT

A specified resource duplicate entry found.

400

INVALID_ARGUMENT

Client specified an invalid argument, request body or query param

400

INVALID_ARGUMENT

400

INVALID_ARGUMENT

Client specified an invalid argument, request body or query param

400

INVALID_ARGUMENT

Invalid argument

CONFLICT

A specified resource duplicate entry found.

409

CONFLICT

Request could not be processed due to a conflict







409

CONFLICT

The specified resource is in a conflict







OUT_OF_RANGE

Client specified an invalid range.

400

OUT_OF_RANGE

Client specified an invalid range

400

OUT_OF_RANGE













PERMISSION_DENIED

Client does not have sufficient permissions to perform this action.

403

PERMISSION_DENIED

Client does not have sufficient permissions to perform

403

PERMISSION_DENIED

Operation not allowed: …

403

PERMISSION_DENIED

Client does not have sufficient permissions to perform this action

403

PERMISSION_DENIED

Operation not allowed: …

ABORTED

Concurrency conflict.

409

ABORTED

Concurrency conflict.



















ALREADY_EXISTS

The resource that a client tried to create already exists.

409

ALREADY_EXISTS

The resource that a client tried to create already exists.



















Service Exceptions

UNAUTHENTICATED

Request not authenticated due to missing, invalid, or expired credentials.

401

UNAUTHENTICATED

Request not authenticated due to missing, invalid, or expired







401

UNAUTHENTICATED

Request not authenticated due to missing, invalid, or expired credentials

401

UNAUTHENTICATED

Authorization failed: ...

NOT_FOUND

The specified resource is not found.

404

NOT_FOUND

The specified resource is not found.

404

NOT_FOUND

404

NOT_FOUND

The specified resource is not found

404

NOT_FOUND

The specified resource is not found





404

OUT_OF_RANGE

NOT_FOUND

Out Of Range

Not found



















TOO_MANY_REQUESTS

Either out of resource quota or reaching rate limiting.

429

TOO_MANY_REQUESTS

Either out of resource quota or reaching rate limiting.



















AUTHENTICATION_REQUIRED

New authentication is required.

401

AUTHENTICATION_REQUIRED

New authentication is required.



















Server Exceptions

FAILED_PRECONDITION

Request cannot be executed in the current system state.

412

FAILED_PRECONDITION

Request cannot be executed in the current system state.



















DATA_LOSS

Unrecoverable data loss or data corruption.

???























INTERNAL

Unknown server error. Typically a server bug.

500

INTERNAL

Unknown server error. Typically a server bug.

500

INTERNAL

Internal server error: …

500

INTERNAL

Server error

500

INTERNAL

Internal server error

BAD_GATEWAY

An upstream internal service cannot be reached.

502

BAD_GATEWAY

Couldn't reach an upstream internal service.



















UNAVAILABLE

Request timeout exceeded.

503

UNAVAILABLE

Service unavailable

503

UNAVAILABLE

Service unavailable

503

UNAVAILABLE

Service unavailable

503

UNAVAILABLE

Service unavailable

TIMEOUT

Request timeout exceeded.

504

TIMEOUT

Request timeout exceeded



















NOT_IMPLEMENTED

This functionality is not implemented yet

501

NOT_IMPLEMENTED

This functionality is not implemented yet

501

NOT_IMPLEMENTED

Service not implemented for the specified user device













METHOD_NOT_ALLOWED

The requested method is not allowed/supported on the target resource.

405

METHOD_NOT_ALLOWED

The requested method is not allowed/supported on the target



















NOT_ACCEPTABLE

The server cannot produce a response matching the content requested by the client through Accept-* headers.

406

NOT_ACCEPTABLE

The server cannot produce a response matching the content requested by the client through Accept-* headers.



















UNSUPPORTED_MEDIA_TYPE

The server refuses to accept the request because the payload format is in an unsupported format.

415

UNSUPPORTED_MEDIA_TYPE

The server refuses to accept the request because the payload format is in an unsupported format























API Design Guidelines chapter 6

Proposal for Device Identifier - https://github.com/camaraproject/Commonalities/issues/127

Error code

Description

Status  

Error code

Description

INVALID_ARGUMENT

A specified resource duplicate entry found.

400

INVALID_ARGUMENT

device does not comply with the schema





422

UNSUPPORTED_DEVICE_IDENTIFIERS

phoneNumber is required

NOT_FOUND

The specified resource is not found.

404

DEVICE_NOT_FOUND

Device identifier not found





422

DEVICE_IDENTIFIERS_MISMATCH

Provided device identifiers are not consistent





403

INVALID_TOKEN_CONTEXT

Device identifiers are not consistent with access token





422

DEVICE_NOT_SUPPORTED

The service is not available for the provided device





https://github.com/camaraproject/Commonalities/pull/145

NOT_IMPLEMENTED

This functionality is not implemented yet

501

PHONE_NUMBER_NOT_SUPPORTED

Service not supported for this phone number