You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second one returns an HTTP 500 error due to a unique constraint violation on the data:
Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Eindeutiger Index oder Primärschlüssel verletzt: "PUBLIC.IDX_UFOSIGHTING_UNIQUE_INDEX_8 ON PUBLIC.UFOSIGHTINGS(SEEING_AT, CITY, STATE, COUNTRY, SHAPE, DURATION, COMMENTS) VALUES 9299"
Expectation:
There must not be an HTTP 500 response but a proper GraphQLError
The unique index violation seems to be intentional, albeit arguable.
The text was updated successfully, but these errors were encountered:
stuebingerb
changed the title
[examples/ktor] Inserting the same Sighting twice causes HTTP 500 error
[examples/ktor] Inserting the same sighting twice causes HTTP 500 error
Nov 8, 2024
I can see the exception being wrapped in ParallelRequestExecutor but the result of schema.execute is still the original (unwrapped) exception. I believe the wrapped exception is swallowed in internal suspend fun <T, R> Collection<T>.toMapAsync:
val jobs = map { item ->
launch(dispatcher) {
try {
val res = block(item)
channel.send(item to res)
} catch (e: Exception) {
channel.close(e)
}
}
}
Not yet sure where the unwrapped exception then comes from, especially seeing some tests work as expected.
Looks like some tests actually expect schema.execute to throw unwrapped exceptions. Not sure how this was supposed to work. It is also a bit confusing to see exceptions being caught in a code block commented with "exceptions are not caught on purpose to pass up business logic errors". This might be a bigger issue.
To reproduce, execute the following mutation twice against the ktor example:
First one returns the expected id:
Second one returns an HTTP 500 error due to a unique constraint violation on the data:
Expectation:
There must not be an HTTP 500 response but a proper GraphQLError
The unique index violation seems to be intentional, albeit arguable.
The text was updated successfully, but these errors were encountered: