public bool HandlesStatusCode(Nancy.HttpStatusCode statusCode, NancyContext context) { Exception exception; if (!context.TryGetException(out exception) || exception == null) { return false; } return statusCode == HttpStatusCode.InternalServerError; }