Docs / EventSourcingDB / Errors / event-type-unknown

event-type-unknown

The event type that the request asks for has neither events nor a schema.

  • Route: read-event-type
  • Description: event type is unknown: it has neither events nor a registered schema
  • Details: value, the event type as the request gave it.

Why It Happens#

The database knows an event type once an event of that type has been written or a schema has been registered for it, see Registering Event Schemas. Reading an event type that has neither is refused. A typical cause is a typo in the type, or a read of a type before its first event has been written.

To see which event types the database knows, list them with the route read-event-types, see Listing Event Types.

How to Fix It#

Check the type for typos against the list of event types. The same request succeeds once an event of the type has been written or a schema has been registered for it; until then, it fails the same way.

Example#

To read the event type io.eventsourcingdb.library.book-borrowed before any book has been borrowed, and without a schema for it, EventSourcingDB answers with this error:

{
  "type": "error",
  "data": {
    "code": "https://docs.eventsourcingdb.io/errors/event-type-unknown",
    "description": "event type is unknown: it has neither events nor a registered schema",
    "details": {
      "value": "io.eventsourcingdb.library.book-borrowed"
    }
  }
}