writeErrorResponse method
Future<void>
writeErrorResponse(
- dynamic request,
- dynamic err,
- dynamic stacktrace
)
Implementation
Future<void> writeErrorResponse(request, err, stacktrace) async {
if (container.read('@environment') == Environment.production) {
// if things are production, we need to treat this all differently.
return await writeResponse(request, Future.value(Response.Boom()));
} else {
return await writeResponse(request, Future.value(Response.Boom('''
Something went wrong.
${err.toString()}
${stacktrace.toString()}
''')));
}
}