Since communication between the client and MATLAB® Production Server™ is over HTTP, many errors are indicated by an HTTP status code. Errors in the deployed MATLAB function use a different format. See Structure of MATLAB Error for more information. To review API usage, see RESTful API.
HTTP Status Codes
400–Bad Request
Message | Description |
---|---|
Invalid input | Client request is not formatted correctly. |
Invalid JSON | Client request does not contain a valid JSON representation. |
nargout missing | Client request does not specify nargout containing output arguments. |
rhs missing | Client request does not specify rhs containing input arguments. |
Invalid rhs | Input arguments does not follow the JSON representation for MATLAB data types. |
403–Forbidden
Message | Description |
---|---|
The client is not authorized to access the requested component | Client does not have the correct credentials to make a request. |
404–Not Found
Message | Description |
---|---|
Function not found | Server could not find the MATLAB function in the deployed CTF archive. |
Component not found | Was unable to find the CTF archive. |
URI-path not of form '/APPLICATION/FUNCTION' | URL not in the correct format. |
405–Method Not Allowed
Message | Description |
---|---|
Bad Method | Method is not allowed. |
Method must be POST | Method is not allowed. |
Unsupported method | Method is not allowed. |
411–Length Required
Message | Description |
---|---|
Content-length missing | Length of the content is missing. |
415–Unsupported Media Type
Message | Description |
---|---|
<VALUE> is not an accepted content type | Did not set correct content type for JSON. |
500–Internal Server Error
Message | Description |
---|---|
Function return type not supported | MATLAB function deployed on the server returned a MATLAB data type that MATLAB Production Server does not support. |
Resource Query vs Resource States
Resources / Server States | NOT_FOUND | READING | IN_QUEUE | PROCESSING | READY | ERROR | CANCELLED | DELETED / PURGED | UNKNOWN SERVER ERROR |
---|---|---|---|---|---|---|---|---|---|
GET |
|
|
|
|
|
|
|
|
|
POST |
|
|
|
|
|
|
|
|
|
DELETE |
|
|
|
|
|
|
|
|
|
In order to resolve a MATLAB error, you will need to troubleshoot the MATLAB function deployed on the server.
{"error": { "type": "matlaberror", "id": error_id, "message": error_message, "stack": [ {"file": file_name1, "name": function_name1, "line": file_line_number1}, {"file": file_name2, "name": function_name2, "line": file_line_number2}, ...]}} |
Client programmers using JavaScript® need to verify whether Cross-Origin Resource Sharing (CORS) is enabled on a MATLAB Production Server instance if their clients programs will be making requests from different domains. If CORS is not enabled, you may get the following error message:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
For information on how to enable CORS, see cors-allowed-origins
.