@@ -9,7 +9,7 @@ use crate::error::Error as SqldError;
9
9
use crate :: hrana;
10
10
use crate :: query:: { Params , Query , Value } ;
11
11
use crate :: query_analysis:: Statement ;
12
- use crate :: query_result_builder:: QueryResultBuilder ;
12
+ use crate :: query_result_builder:: { QueryResultBuilder , QueryResultBuilderError } ;
13
13
14
14
/// An error during execution of an SQL statement.
15
15
#[ derive( thiserror:: Error , Debug ) ]
@@ -43,6 +43,8 @@ pub enum StmtError {
43
43
44
44
#[ error( "Operation was blocked{}" , . reason. as_ref( ) . map( |msg| format!( ": {}" , msg) ) . unwrap_or_default( ) ) ]
45
45
Blocked { reason : Option < String > } ,
46
+ #[ error( "Response is too large" ) ]
47
+ ResponseTooLarge ,
46
48
}
47
49
48
50
pub async fn execute_stmt (
@@ -196,6 +198,9 @@ pub fn stmt_error_from_sqld_error(sqld_error: SqldError) -> Result<StmtError, Sq
196
198
SqldError :: LibSqlInvalidQueryParams ( source) => StmtError :: ArgsInvalid { source } ,
197
199
SqldError :: LibSqlTxTimeout => StmtError :: TransactionTimeout ,
198
200
SqldError :: LibSqlTxBusy => StmtError :: TransactionBusy ,
201
+ SqldError :: BuilderError ( QueryResultBuilderError :: ResponseTooLarge ( _) ) => {
202
+ StmtError :: ResponseTooLarge
203
+ }
199
204
SqldError :: Blocked ( reason) => StmtError :: Blocked { reason } ,
200
205
SqldError :: RusqliteError ( rusqlite_error) => match rusqlite_error {
201
206
rusqlite:: Error :: SqliteFailure ( sqlite_error, Some ( message) ) => StmtError :: SqliteError {
@@ -242,6 +247,7 @@ impl StmtError {
242
247
Self :: SqliteError { source, .. } => sqlite_error_code ( source. code ) ,
243
248
Self :: SqlInputError { .. } => "SQL_INPUT_ERROR" ,
244
249
Self :: Blocked { .. } => "BLOCKED" ,
250
+ Self :: ResponseTooLarge => "RESPONSE_TOO_LARGE" ,
245
251
}
246
252
}
247
253
}
0 commit comments