Trait/Object

com.lightbend.lagom.scaladsl.api.transport

TransportErrorCode

Related Docs: object TransportErrorCode | package transport

Permalink

sealed trait TransportErrorCode extends Serializable

An error code that gets translated into an appropriate underlying error code.

This attempts to match up corresponding HTTP error codes with WebSocket close codes, so that user code can generically select a code without worrying about the underlying transport.

While most WebSocket close codes that we typically use do have a corresponding HTTP error code, there are many HTTP error codes that don't have a corresponding WebSocket close code. In these cases, we use the private WebSocket close code range (4xxx), with the HTTP error code as the last three digits. Such WebSocket close codes will be in the range 4400 to 4599.

This class should only be used to represent error codes, status codes like HTTP 200 should not be represented using this class. This is enforced for HTTP codes, since they have a well defined categorisation, codes between 400 and 599 are considered errors. It is however not enforced for WebSockets, since the WebSocket protocol defines no such categorisation of codes, it specifies a number of well known codes from 1000 to 1015, with no particular pattern to their meaning, and the remaining codes are only categorised by whether they are private, reserved for the WebSocket spec, or reserved for applications to specify.

For WebSocket close codes that are not known, or are not in the private range of 4400 to 4599 defined by us, this use class uses the generic HTTP 404 error code.

Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TransportErrorCode
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val description: String

    Permalink

    A description of this close code.

    A description of this close code.

    This description will be meaningful for known built in close codes, but for other codes, it will be Unknown error code

    returns

    A description of this closed code.

  2. abstract val http: Int

    Permalink

    The HTTP status code for this error.

  3. abstract val webSocket: Int

    Permalink

    The WebSocket close code for this error.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped