Skip to main content

SimpleUserFacingError

Trait SimpleUserFacingError 

Source
pub trait SimpleUserFacingError {
    const ERROR_CODE: &'static str;
    const MESSAGE: &'static str;
}
Expand description

A less dynamic type of user-facing errors. This is used in the introspection and migration engines for simpler, more robust and helpful error handling — extra details are attached opportunistically.

Required Associated Constants§

Source

const ERROR_CODE: &'static str

Source

const MESSAGE: &'static str

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl SimpleUserFacingError for ConnectionClosed

Source§

const ERROR_CODE: &'static str = "P1017"

Source§

const MESSAGE: &'static str = "Server has closed the connection."

Source§

impl SimpleUserFacingError for AzureMssqlShadowDb

Source§

const ERROR_CODE: &'static str = "P3020"

Source§

const MESSAGE: &'static str = "The automatic creation of shadow databases is disabled on Azure SQL. Please set up a shadow database using the `shadowDatabaseUrl` datasource attribute.\nRead the docs page for more details: https://pris.ly/d/migrate-shadow"

Source§

impl SimpleUserFacingError for DatabaseMigrationFormatChanged

Source§

const ERROR_CODE: &'static str = "P3003"

Source§

const MESSAGE: &'static str = "The format of migrations changed, the saved migrations are no longer valid. To solve this problem, please follow the steps at: https://pris.ly/d/migrate"

Source§

impl SimpleUserFacingError for DatabaseSchemaNotEmpty

Source§

const ERROR_CODE: &'static str = "P3005"

Source§

const MESSAGE: &'static str = "The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline"

Source§

impl SimpleUserFacingError for DeprecatedProviderArray

Source§

const ERROR_CODE: &'static str = "P3013"

Source§

const MESSAGE: &'static str = "Datasource provider arrays are no longer supported in migrate. Please change your datasource to use a single provider. Read more at https://pris.ly/multi-provider-deprecation"

Source§

impl SimpleUserFacingError for DirectDdlNotAllowed

Source§

const ERROR_CODE: &'static str = "P3022"

Source§

const MESSAGE: &'static str = "Direct execution of DDL (Data Definition Language) SQL statements is disabled on this database. Please read more here about how to handle this: https://pris.ly/d/migrate-no-direct-ddl"

Source§

impl SimpleUserFacingError for ForeignKeyCreationNotAllowed

Source§

const ERROR_CODE: &'static str = "P3021"

Source§

const MESSAGE: &'static str = "Foreign keys cannot be created on this database. Learn more how to handle this: https://pris.ly/d/migrate-no-foreign-keys"

Source§

impl SimpleUserFacingError for IntrospectionResultEmpty

Source§

const ERROR_CODE: &'static str = "P4001"

Source§

const MESSAGE: &'static str = "The introspected database was empty."

Source§

impl SimpleUserFacingError for MigrationNameTooLong

Source§

const ERROR_CODE: &'static str = "P3010"

Source§

const MESSAGE: &'static str = "The name of the migration is too long. It must not be longer than 200 characters (bytes)."

Source§

impl SimpleUserFacingError for MissingNamespaceInExternalTables

Source§

const ERROR_CODE: &'static str = "P3023"

Source§

const MESSAGE: &'static str = "For the current database, `externalTables` & `externalEnums` in your prisma config must contain only fully qualified identifiers (e.g. `schema_name.table_name`)."

Source§

impl SimpleUserFacingError for UnexpectedNamespaceInExternalTables

Source§

const ERROR_CODE: &'static str = "P3024"

Source§

const MESSAGE: &'static str = "For the current database, `externalTables` & `externalEnums` in your prisma config must contain only simple identifiers without a schema name."