Skip to content

Commit

Permalink
fix(user-facing-errors): fix Prisma pipeline, add sqlserver test to s…
Browse files Browse the repository at this point in the history
…ql-migration-tests (#4651)

* fix(user-facing-errors): fix Prisma pipeline, add sqlserver test to sql-migration-tests

* chore(driver-adapters): got rid of broken sqlserver test case
  • Loading branch information
jkomyno authored Jan 18, 2024
1 parent ffecfca commit d3c7899
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libs/user-facing-errors/src/quaint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ pub fn render_quaint_error(kind: &ErrorKind, connection_info: &ConnectionInfo) -
database_host: url.host().to_owned(),
}))
}
(NativeErrorKind::ConnectionError(_), ConnectionInfo::Native(NativeConnectionInfo::Mssql(url))) => {
Some(KnownError::new(common::DatabaseNotReachable {
database_port: url.port(),
database_host: url.host().to_owned(),
}))
}
(NativeErrorKind::TlsError { message }, _) => Some(KnownError::new(common::TlsConnectionError {
message: message.into(),
})),
Expand Down
4 changes: 4 additions & 0 deletions schema-engine/sql-migration-tests/tests/errors/error_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ fn authentication_failure_must_return_a_known_error_on_mysql(api: TestApi) {
assert_eq!(json_error, expected);
}

// TODO(tech-debt): get rid of provider-specific PSL `dm` declaration, and use `test_api::datamodel_with_provider` utility instead.
// See: https://github.com/prisma/team-orm/issues/835.
// This issue also currently prevents us from defining an `Mssql`-specific copy of this `unreachable_database_*` test case,
// due to url parsing differences between the `url` crate and `quaint`'s `MssqlUrl` struct.
#[test_connector(tags(Mysql))]
fn unreachable_database_must_return_a_proper_error_on_mysql(api: TestApi) {
let mut url: Url = api.connection_string().parse().unwrap();
Expand Down

0 comments on commit d3c7899

Please sign in to comment.