Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pg arguments add error type #3564

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sqlx-postgres/src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct PgArguments {
}

impl PgArguments {
pub(crate) fn add<'q, T>(&mut self, value: T) -> Result<(), BoxDynError>
pub(crate) fn add<'q, T>(&mut self, value: T) -> Result<(), Error>
where
T: Encode<'q, Postgres> + Type<Postgres>,
{
Expand All @@ -82,7 +82,7 @@ impl PgArguments {
// reset the value buffer to its previous value if encoding failed,
// so we don't leave a half-encoded value behind
self.buffer.reset_to_snapshot(buffer_snapshot);
return Err(error);
return Err(Error::Encode(error));
};

// remember the type information for this value
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<'q> Arguments<'q> for PgArguments {
self.buffer.reserve(size);
}

fn add<T>(&mut self, value: T) -> Result<(), BoxDynError>
fn add<T>(&mut self, value: T) -> Result<(), Error>
where
T: Encode<'q, Self::Database> + Type<Self::Database>,
{
Expand Down