File tree Expand file tree Collapse file tree 2 files changed +4
-18
lines changed
DataGateway.Service.Tests/SqlTests
DataGateway.Service/Resolvers Expand file tree Collapse file tree 2 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -472,9 +472,8 @@ await SetupAndRunRestApiTest(
472472 operationType : Operation . Upsert ,
473473 requestBody : requestBody ,
474474 exception : true ,
475- expectedErrorMessage : $ "Could not perform the given mutation on entity books. " +
476- "Request contains value for field that is autogenerated." ,
477- expectedStatusCode : ( int ) HttpStatusCode . BadRequest ,
475+ expectedErrorMessage : $ "Could not perform the given mutation on entity books.",
476+ expectedStatusCode : ( int ) HttpStatusCode . InternalServerError ,
478477 expectedSubStatusCode : DatagatewayException . SubStatusCodes . DatabaseOperationFailed . ToString ( )
479478 ) ;
480479 }
Original file line number Diff line number Diff line change @@ -151,22 +151,9 @@ await PerformMutationOperation(
151151 Console . Error . WriteLine ( ex . Message ) ;
152152 Console . Error . WriteLine ( ex . StackTrace ) ;
153153
154- StringBuilder messageDetails = new ( $ "Could not perform the given mutation on entity { context . EntityName } .") ;
155- int statusCode = ( int ) HttpStatusCode . InternalServerError ;
156- SqlException sqlException = ex as SqlException ;
157-
158- if ( sqlException != null )
159- {
160- if ( sqlException . Number == 544 )
161- {
162- messageDetails . Append ( " Request contains value for field that is autogenerated." ) ;
163- statusCode = ( int ) HttpStatusCode . BadRequest ;
164- }
165- }
166-
167154 throw new DatagatewayException (
168- message : messageDetails . ToString ( ) ,
169- statusCode : statusCode ,
155+ message : $ "Could not perform the given mutation on entity { context . EntityName } ." ,
156+ statusCode : ( int ) HttpStatusCode . InternalServerError ,
170157 subStatusCode : DatagatewayException . SubStatusCodes . DatabaseOperationFailed ) ;
171158 }
172159 catch ( Exception ex )
You can’t perform that action at this time.
0 commit comments