Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

Return URL format errors with better response code #40

Closed

Description

@itsjoeconway

If you pass the wrong type of value in a path param - a string when an int is expected - the exception thrown is not caught by the HttpController and yields a 500. Should return a 404. Example trace:

[SEVERE] 2016-01-27 15:45:47.605 monadart: HttpController: Uncaught error in request (/equipment/modes (1453927547602)
user-agent [Paw/2.2.9 (Macintosh; OS X/10.11.3) GCDHTTPRequest],connection [close],host [10.1.10.187:8000],authorization [Bearer SH5FMqBDXHJHzY2UKkJ09UYWa6yyzjSF],
): FormatException: Invalid radix-10 number
modes
#0 int._throwFormatException (dart:core-patch/integers_patch.dart:111)
#1 int._parse (dart:core-patch/integers_patch.dart:101)
#2 int.parse (dart:core-patch/integers_patch.dart:58)
#3 _LocalClassMirror._invoke (dart:mirrors-patch/mirrors_impl.dart:927)
#4 _LocalObjectMirror.invoke (dart:mirrors-patch/mirrors_impl.dart:363)
#5 ModelController.willProcessRequest (package:monadart/db/model_controller.dart:40:18)
#6 HttpController.processRequest.<processRequest_async_body> (package:monadart/base/http_controller.dart:253:7)
#7 Future.Future.microtask. (dart:async/future.dart:144)
#8 _microtaskLoop (dart:async/schedule_microtask.dart:43)
#9 _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#10 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)

.

Activity

  1. rafante commented on May 26, 2020

    @rafante

    I'm having the same issue here =/

    -- Aqueduct CLI Version: 3.3.0+1
    -- Aqueduct project version: 3.2.1
    -- Preparing...
    *** Application failed to start.
    *** Uncaught error
    FormatException: Invalid radix-10 number (at character 1)
    ort
    ^

    **** Stacktrace


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions