Skip to content

Commit

Permalink
Formatting kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Reta committed Nov 22, 2022
1 parent 1151d25 commit b57c162
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DefaultDataFetcherExceptionHandler : DataFetcherExceptionHandler {
}

private fun unwrapCompletionException(e: Throwable): Throwable {
return if(e is CompletionException && e.cause != null) e.cause!! else e
return if (e is CompletionException && e.cause != null) e.cause!! else e
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ internal class DefaultDataFetcherExceptionHandlerTest {

@Test
fun `CompletionException returns wrapped error code`() {
val completionException = CompletionException("com.netflix.graphql.dgs.exceptions.DgsEntityNotFoundException: Requested entity not found",
DgsEntityNotFoundException())
val completionException = CompletionException(
"com.netflix.graphql.dgs.exceptions.DgsEntityNotFoundException: Requested entity not found",
DgsEntityNotFoundException()
)
every { dataFetcherExceptionHandlerParameters.exception }.returns(completionException)

val result = DefaultDataFetcherExceptionHandler().handleException(dataFetcherExceptionHandlerParameters).get()
Expand Down

0 comments on commit b57c162

Please sign in to comment.