PouryaKit
Reference

Error codes

Every Error code the Kit declares, its kind, its message and when it is returned.

The Errors the Kit fails an Operation with, by package. The kind decides the HTTP status (see problem responses); a code constant names the Errors a validation returns, each with its own message.

PouryaKit.Cqrs

CodeKindMessageWhen
Operation.CommandThrewUnexpectedA command failed with an exception, so the Operation was rolled back.A command inside the Operation threw, so the Operation was rolled back, even when the code that sent the command handled the exception. The Error carries no exception text.
Operation.ReadingChangedStateUnexpectedCode that only reads changed tracked state, so the Operation was rolled back.Code that only reads, such as a query, an authorizer, a validator or a step opened with Operation.OnlyReading(string), changed tracked state, so the Operation was rolled back.
Page.DirectionUnknownThe direction is neither ascending nor descending; the target is Direction.
Page.FilterOperatorUnsupportedThe field does not declare the filter's operator; the target is the filter.
Page.FilterRepeatedA field and operator are given twice; the target is the second filter.
Page.FilterUnknownThe filter's field is not declared; the target is the filter, Filters[i].
Page.FilterValueInvalidThe filter's value is not of the field's type; the target is the filter.
Page.NumberOutOfRangeThe number is below 1 or past the last Page an offset can reach; the target is Number.
Page.SizeOutOfRangeThe size is outside 1 to the declared maximum; the target is Size.
Page.SortUnknownThe sort key is not declared; the target is Sort.
Tenant.MismatchForbiddenThis operation changes data of another tenant than its own, or moves data between tenants, so nothing was saved.The Operation would save a tenant-scoped aggregate that is not its tenant's: one it added for another tenant, or one it changed or removed that belonged to another tenant when it was loaded, or whose tenant it changed. Nothing was saved.
Tenant.NotLoadedForbiddenThis operation changes tenant data it did not load, so nothing was saved.The Operation would save a change to a tenant-scoped aggregate, or to a part of one, that it attached instead of loading it through a query: a tenant-scoped aggregate is loaded, never attached, since an attached entity's key may name another tenant's row. Nothing was saved.
Tenant.RequiredForbiddenThis operation runs only for a tenant, and its context names none.The Operation has no tenant, and every Operation of its Module needs one. Nothing ran.

PouryaKit.Email

CodeKindMessageWhen
Email.InvalidAddressValidationThe recipient is not one mailbox address with a domain, such as ada@example.com.The message's recipient is not one mailbox address with a domain. Nothing was sent.

PouryaKit.Persistence

CodeKindMessageWhen
UnitOfWork.ConcurrencyConflictConflictAnother operation changed the same data first, so nothing was saved.Another Operation committed a change to an aggregate this Operation changed, after this one read it; or the Operation wrote an aggregate it attached rather than loaded, whose stored row has another version or no longer exists; or, in PouryaKit.Persistence.Postgres, PostgreSQL ended a deadlock by aborting this Operation's wait for a number sequence; or, in PouryaKit.Persistence.Marten, another Operation appended to a Stream this Operation changed after this one read it, or started a Stream this Operation started too. Nothing was committed; the caller decides whether to run the Operation again, in a new scope.

PouryaKit.Realtime

CodeKindMessageWhen
Realtime.ChannelNotAdmittedForbiddenThe caller may not listen on a channel the request names.The endpoint's rule does not admit the caller to a Channel the request names. No connection was opened.
Realtime.ChannelRequiredValidationName at least one channel to listen on, with the channel query parameter.The request names no Channel to listen on, or a blank one. No connection was opened.
Realtime.PayloadTooLargeValidationThe realtime event, with its channel and tenant, is 8000 bytes or more, which PostgreSQL does not carry. Push a small fact or a reference, and let the client read the rest through a query.The push's notification, its Channel, tenant and event in the Kit's JSON, is 8000 bytes or more, which PostgreSQL does not carry. Nothing was pushed.

PouryaKit.Reporting

CodeKindMessageWhen
Reporting.LogoFormatValidationThe report's logo is not a readable PNG or JPEG image.The branding's logo is not a PNG or JPEG image PDFsharp can load, such as another format or a file cut short; a PDF draws those two formats only.
Reporting.TableShapeValidationThe report's table has no column, or a row whose number of cells differs from its number of columns.The layout's table has no column, or a row whose number of cells differs from its number of columns.

PouryaKit.Reporting.Module

CodeKindMessageWhen
Reports.JobNotFoundNotFoundThe report job does not exist.
Reports.RequestDeniedForbiddenThis report may not be requested with these parameters.

PouryaKit.Security

CodeKindMessageWhen
Permission.DeniedForbiddenThis operation requires a permission its actor does not hold.The Actor does not hold the permission the command or query declares. Nothing ran.

PouryaKit.Storage

CodeKindMessageWhen
Storage.FileNotFoundNotFoundNo file is stored under this key.No file is stored under the key the call names.
Storage.LinkLifetimeOutOfRangeValidationThe link's lifetime is zero or less, or longer than the {maximum} the file storage provider signs a link for.A presigned link's lifetime is zero or less, or longer than the provider signs a link for: S3 and Azure Blob each sign one for at most seven days. No link was signed.

PouryaKit.Validation

CodeKindMessageWhen
Validation.FailedThe code of a validation failure that carries no error code of its own.

On this page