Falcon v1.0.0 Documentation
also this section of the tutorial. How can I pass data from a hook to a responder, and between hooks? You can inject extra responder kwargs from a hook by adding them to the params dict passed into the hook for the most part, do the right thing. In other words, Falcon doesn’t try very hard to protect responder code from itself. This approach reduces the number of (often) extraneous checks that Falcon would high code coverage. 3. Errors are anticipated, detected, and handled appropriately within each responder and with the aid of custom error handlers. Tip: Falcon will re-raise errors that do not inherit0 码力 | 87 页 | 348.15 KB | 1 年前3Falcon v3.0.0-b2 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder JSONTranslator.process_response • Sinks: /search/(?Pddg|y)\Z SinkAdapter • Error handlers: StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 340 页 | 1.15 MB | 1 年前3Falcon v3.0.0 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder JSONTranslator.process_response • Sinks: /search/(?Pddg|y)\Z SinkAdapter • Error handlers: StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 344 页 | 1.16 MB | 1 年前3Falcon v3.0.1 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder JSONTranslator.process_response • Sinks: /search/(?Pddg|y)\Z SinkAdapter • Error handlers: StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 344 页 | 1.16 MB | 1 年前3Falcon v3.0.0-b1 Documentation
StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError Release 3.0.0b1 (continued from previous page) → JSONTranslator.process_request Process route responder JSONTranslator.process_response • Sinks: /search/(?Pddg|y)\Z SinkAdapter • Error handlers: StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError 0 码力 | 338 页 | 1.14 MB | 1 年前3Falcon v3.1.1-b3 Documentation
previous page) things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder (continues on next page) 22 Chapter 5. Documentation Falcon Documentation, Release 3.1.1b3 (continued StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-b1 Documentation
previous page) things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder (continues on next page) 22 Chapter 5. Documentation Falcon Documentation, Release 3.1.1b1 (continued StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.1-a Documentation
previous page) things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder (continues on next page) 22 Chapter 5. Documentation Falcon Documentation, Release 3.1.1 (continued StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError0 码力 | 378 页 | 1.29 MB | 1 年前3Falcon v3.1.0 Documentation
previous page) things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder (continues on next page) 22 Chapter 5. Documentation Falcon Documentation, Release 3.1.0 (continued StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError0 码力 | 362 页 | 1.29 MB | 1 年前3Falcon v3.1.1 Documentation
previous page) things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError AuthMiddleware.process_request → RequireJSON.process_request → JSONTranslator.process_request Process route responder (continues on next page) 22 Chapter 5. Documentation Falcon Documentation, Release 3.1.1 (continued StorageEngine() things = ThingsResource(db) app.add_route('/{user_id}/things', things) # If a responder ever raises an instance of StorageError, pass control to # the given handler. app.add_error_handler(StorageError0 码力 | 378 页 | 1.29 MB | 1 年前3
共 36 条
- 1
- 2
- 3
- 4