com.convergencelabs.convergence.server.api.realtime.ErrorCodes.scala Maven / Gradle / Ivy
/*
* Copyright (c) 2019 - Convergence Labs, Inc.
*
* This file is part of the Convergence Server, which is released under
* the terms of the GNU General Public License version 3 (GPLv3). A copy
* of the GPLv3 should have been provided along with this file, typically
* located in the "LICENSE" file, which is part of this source code package.
* Alternatively, see for the
* full text of the GPLv3 license, if it was not provided.
*/
package com.convergencelabs.convergence.server.api.realtime
import com.fasterxml.jackson.core.`type`.TypeReference
/**
* The ErrorCodes enumeration defines the set of error strings that
* can be sent back to the client.
*/
object ErrorCodes extends Enumeration {
type ErrorCode = Value
//
// Common Error Codes
//
val InvalidMessage: ErrorCode = Value("invalid_message")
val Unknown: ErrorCode = Value("unknown")
val Timeout: ErrorCode = Value("timeout")
val Unauthorized: ErrorCode = Value("unauthorized")
val MalformedRequestContent: ErrorCode = Value("malformed_request_content")
val NotSupported: ErrorCode = Value("not_supported")
//
// Identity Related Errors
//
val GroupNotFound: ErrorCode = Value("group_not_found")
val UserNotFound: ErrorCode = Value("user_not_found")
//
// Activity Errors
//
val ActivityAlreadyJoined: ErrorCode = Value("activity_already_joined")
val ActivityNotJoined: ErrorCode = Value("activity_not_joined")
val ActivityNotFound: ErrorCode = Value("activity_not_found")
val ActivityAlreadyExists: ErrorCode = Value("activity_already_exists")
val ActivityNoSuchResource: ErrorCode = Value("no_such_resource_id")
//
// Model Errors
//
val ModelUnknownResourceId: ErrorCode = Value("unknown_resource_id")
val ModelNotFound: ErrorCode = Value("model_not_found")
val ModelNotOpen: ErrorCode = Value("model_not_open")
val ModelAlreadyOpen: ErrorCode = Value("model_already_open")
val ModelAlreadyOpening: ErrorCode = Value("model_already_opening")
val ModelAlreadyExists: ErrorCode = Value("model_already_exists")
val ModelClientDataRequestFailure: ErrorCode = Value("data_request_failure")
val InvalidModelCreationData: ErrorCode = Value("invalid_model_creation_data")
val CollectionDoesNotExist: ErrorCode = Value("collection_does_not_exist")
val ModelClosingAfterError: ErrorCode = Value("model_closing_after_error")
val ModelInvalidQuery: ErrorCode = Value("invalid_query")
val ModelDeleted: ErrorCode = Value("model_deleted")
val ModelInvalidOperation: ErrorCode = Value("invalid_operation")
//
// Chat Related Errors
//
val ChatNotFound: ErrorCode = Value("chat_not_found")
val ChatNotJoined: ErrorCode = Value("chat_not_joined")
val ChatAlreadyJoined: ErrorCode = Value("chat_already_joined")
val ChatAlreadyMember: ErrorCode = Value("chat_already_a_member")
val NotAlreadyMember: ErrorCode = Value("not_a_member")
val CantRemoveSelf: ErrorCode = Value("cant_remove_self")
val ChatAlreadyExists: ErrorCode = Value("chat_already_exists")
}
class ErrorCodesTypeReference extends TypeReference[ErrorCodes.type] {}