Docs / EventSourcingDB / Errors / event-type-missing

event-type-missing

The request leaves out an event type.

  • Routes: write-events, read-event-type, and register-event-schema
  • Description: event type is missing: expected a reverse domain name such as 'io.eventsourcingdb.library.book-acquired'
  • Details: When writing events, event, the place of the event in its list, counting from 0. On the other routes, none; details is an empty object.

Why It Happens#

Every event has a type, and reading an event type or registering a schema for one needs to know which. The database reports this error when type is left out or is an empty string, in an event of a write or at the top level of the request. A typical cause is a type taken from a variable or a setting that turns out to be empty.

A fromLatestEvent without its type is reported as from-latest-event-incomplete instead.

How to Fix It#

Send the event type as a reverse domain name, such as io.eventsourcingdb.library.book-acquired. Sending the same request again fails the same way, since the error depends on the request alone.

Example#

For a write whose first event leaves out its type, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its end item:

{
  "type": "error",
  "data": {
    "code": "https://docs.eventsourcingdb.io/errors/event-type-missing",
    "description": "event type is missing: expected a reverse domain name such as 'io.eventsourcingdb.library.book-acquired'",
    "details": {
      "event": 0
    }
  }
}