Skip to content

Commit

Permalink
Better error propagation in Restful
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Jul 17, 2023
1 parent 5e9b8f0 commit 2a0911e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/scala/spice/http/server/rest/Restful.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ abstract class Restful[Request, Response](implicit val requestRW: RW[Request],

def validations: List[RestfulValidation[Request]] = Nil

def error(throwable: Throwable): RestfulResponse[Response] = error(List(ValidationError("An internal error occurred")), HttpStatus.InternalServerError)
def error(throwable: Throwable): RestfulResponse[Response] =
error(List(ValidationError("An internal error occurred")), HttpStatus.InternalServerError)

def error(message: String): RestfulResponse[Response] =
error(List(ValidationError(message)), HttpStatus.InternalServerError)
Expand Down Expand Up @@ -87,7 +88,6 @@ abstract class Restful[Request, Response](implicit val requestRW: RW[Request],
apply(exchange, request)
.timeout(timeout)
.handleError { throwable =>
scribe.error(s"Error occurred in ${getClass.getName}", throwable)
error(throwable)
}
} catch {
Expand Down

0 comments on commit 2a0911e

Please sign in to comment.