Status Codes

Status Code is introduced in the latest version. For example, as IoTDB requires registering the time series first before writing data, a kind of solution is:

  1. try {
  2. writeData();
  3. } catch (SQLException e) {
  4. // the most case is that the time series does not exist
  5. if (e.getMessage().contains("exist")) {
  6. //However, using the content of the error message is not so efficient
  7. registerTimeSeries();
  8. //write data once again
  9. writeData();
  10. }
  11. }

With Status Code, instead of writing codes like if (e.getErrorMessage().contains("exist")), we can simply use e.getErrorCode() == TSStatusCode.TIME_SERIES_NOT_EXIST_ERROR.getStatusCode().

Here is a list of Status Code and related message:

Status CodeStatus TypeMeanings
200SUCCESS_STATUS
201STILL_EXECUTING_STATUS
202INVALID_HANDLE_STATUS
203INCOMPATIBLE_VERSIONIncompatible version
298NODE_DELETE_FAILED_ERRORFailed while deleting node
299ALIAS_ALREADY_EXIST_ERRORAlias already exists
300PATH_ALREADY_EXIST_ERRORPath already exists
301PATH_NOT_EXIST_ERRORPath does not exist
302UNSUPPORTED_FETCH_METADATA_OPERATION_ERRORUnsupported fetch metadata operation
303METADATA_ERRORMeet error when dealing with metadata
305OUT_OF_TTL_ERRORInsertion time is less than TTL time bound
306CONFIG_ADJUSTERIoTDB system load is too large
307MERGE_ERRORMeet error while merging
308SYSTEM_CHECK_ERRORMeet error while system checking
309SYNC_DEVICE_OWNER_CONFLICT_ERRORSync device owners conflict
310SYNC_CONNECTION_EXCEPTIONMeet error while sync connecting
311STORAGE_GROUP_PROCESSOR_ERRORStorage group processor related error
312STORAGE_GROUP_ERRORStorage group related error
313STORAGE_ENGINE_ERRORStorage engine related error
314TSFILE_PROCESSOR_ERRORTsFile processor related error
315PATH_ILLEGALIllegal path
316LOAD_FILE_ERRORMeet error while loading file
400EXECUTE_STATEMENT_ERRORExecute statement error
401SQL_PARSE_ERRORMeet error while parsing SQL
402GENERATE_TIME_ZONE_ERRORMeet error while generating time zone
403SET_TIME_ZONE_ERRORMeet error while setting time zone
404NOT_STORAGE_GROUP_ERROROperating object is not a storage group
405QUERY_NOT_ALLOWEDQuery statements are not allowed error
406AST_FORMAT_ERRORAST format related error
407LOGICAL_OPERATOR_ERRORLogical operator related error
408LOGICAL_OPTIMIZE_ERRORLogical optimize related error
409UNSUPPORTED_FILL_TYPE_ERRORUnsupported fill type related error
410PATH_ERRORPath related error
411QUERY_PROCESS_ERRORQuery process related error
412WRITE_PROCESS_ERRORWriting data related error
500INTERNAL_SERVER_ERRORInternal server error
501CLOSE_OPERATION_ERRORMeet error in close operation
502READ_ONLY_SYSTEM_ERROROperating system is read only
503DISK_SPACE_INSUFFICIENT_ERRORDisk space is insufficient
504START_UP_ERRORMeet error while starting up
600WRONG_LOGIN_PASSWORD_ERRORUsername or password is wrong
601NOT_LOGIN_ERRORHas not logged in
602NO_PERMISSION_ERRORNo permissions for this operation
603UNINITIALIZED_AUTH_ERRORUninitialized authorizer

All exceptions are refactored in latest version by extracting uniform message into exception classes. Different error codes are added to all exceptions. When an exception is caught and a higher-level exception is thrown, the error code will keep and pass so that users will know the detailed error reason. A base exception class “ProcessException” is also added to be extended by all exceptions.