Skip to content

Commit

Permalink
replace ErrorHandler::Conflict with ErrorHandler::Server on conflict-…
Browse files Browse the repository at this point in the history
…free query
  • Loading branch information
jgallagher committed Feb 26, 2024
1 parent 16d749f commit f99fbdc
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions nexus/db-queries/src/db/datastore/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ impl DataStore {
) -> CreateResult<Option<Dataset>> {
use db::schema::dataset::dsl;

let dataset_id = dataset.id();
let zpool_id = dataset.pool_id;
Zpool::insert_resource(
zpool_id,
Expand All @@ -117,13 +116,9 @@ impl DataStore {
type_name: ResourceType::Zpool,
lookup_type: LookupType::ById(zpool_id),
},
AsyncInsertError::DatabaseError(e) => public_error_from_diesel(
e,
ErrorHandler::Conflict(
ResourceType::Dataset,
&dataset_id.to_string(),
),
),
AsyncInsertError::DatabaseError(e) => {
public_error_from_diesel(e, ErrorHandler::Server)
}
})
}

Expand Down

0 comments on commit f99fbdc

Please sign in to comment.