error property

dynamic error

Returns an error that can be thrown when the parameter is not present.

Implementation

get error {
  if (cookie?.isNotEmpty == true) {
    return AngelHttpException.badRequest(
        message: 'Missing required cookie "$cookie".');
  }
  if (header?.isNotEmpty == true) {
    return AngelHttpException.badRequest(
        message: 'Missing required header "$header".');
  }
  if (query?.isNotEmpty == true) {
    return AngelHttpException.badRequest(
        message: 'Missing required query parameter "$query".');
  }
  if (session?.isNotEmpty == true) {
    return StateError('Session does not contain required key "$session".');
  }
}