Back to Basics: Exceptions
Back to Basics: Exceptions Klaus Iglberger, CppCon 2020 klaus.iglberger@gmx.de2 Klaus Iglberger C++ Trainer since 2016 Author of the C++ math library (Co-)Organizer of the Munich deContent 3 The Exception Situation How Do Exceptions Work Best Practices of Exception Handling When to Use Exceptions (And When Not) How to Use Exceptions The Exception Safety Guarantees How to Write CodeContent 4 The Exception Situation How Do Exceptions Work Best Practices of Exception Handling When to Use Exceptions (And When Not) How to Use Exceptions The Exception Safety Guarantees How to Write0 码力 | 111 页 | 4.87 MB | 5 月前3Exceptions Under the Spotlight
EXCEPTIONS UNDER THE SPOTLIGHT INBAL LEVIWHO AM I? • AC++ enthusiast. • An embedded software engineer at Solar Edge working on smart home. • One of the organizers of CoreCpp conference and user group founders of the Israeli NB. • I’ve studied physics, I also love math. 2MOTIVATION Q14 Is throwing exceptions to report errors allowed throughout your current project? ISO Survey 2020 45.1% 37.1% 17.8% Audio 54.9% 3 How many of you are using Exceptions in your projects?• Many industries and C++ projects (Such as Embedded, GPUs and Gaming) avoid using exceptions for performance reasons. • The error0 码力 | 53 页 | 2.82 MB | 5 月前3C++ Exceptions for Smaller Firmware
C++ Exceptions for Smaller Firmware By: Khalil Estell (@kammce)@kammce Graduated 2017 from SJSU Ex-Googler (~6y) Volunteer @ SJSU ISO C++ Committee Member 2Motivation 345Microcontroller Constraints: into C++26 @ St Louis 2024 ISO C++ meetingTIME SPACE So why do firmware developers avoid C++ exceptions? 14 Requires Dynamic Memory/Heap Increases Binary Size Requires whole C++ STL Run Time Type me / 2); p_pin.level(false); delay(p_transition_time / 2); } 31 The code if we used exceptions…32 The code if we used std::expected status toggle_led( output_pin& p_pin, milliseconds p_transition_time0 码力 | 237 页 | 6.74 MB | 5 月前3Exceptionally Bad: The Story on the Misuse of Exceptions and How to Do Better
2023 Bloomberg Finance L.P. All rights reserved. Exceptionally Bad: The story on the misuse of exceptions and how to do better Core C++ June 7, 2023 Pete Muldoon Senior Engineering Lead© 2023 Bloomberg Exceptionally Bad: The story on the misuse of exceptions and how to do better Core C++ June 7, 2023 Pete Muldoon Senior Engineering Lead Exceptions in C++ Better Design Through Analysis of Real World going ? • Talk will be about Exceptions as seen in C++ • Look at original goals/ideals of exception handling • Look at the mechanics of throw/catch • Look at Exceptions in both their use and design as0 码力 | 85 页 | 2.32 MB | 5 月前3Flask Documentation (1.1.x)
for Flask Larger Applications Application Factories Application Dispatching Implementing API Exceptions Using URL Processors Deploying with Setuptools Deploying with Fabric Using SQLite 3 with Flask KeyError [https://docs.python.org/3/library/exceptions.html#KeyError] is raised. You can catch it like a standard KeyError [https://docs.python.org/3/library/exceptions.html#KeyError] but if you don’t do that accessing URL parameters with get or by catching the KeyError [https://docs.python.org/3/library/exceptions.html#KeyError] because users might change the URL and presenting them a 400 bad request page in0 码力 | 428 页 | 895.98 KB | 1 年前3Celery v4.4.5 Documentation
retry after 1 minute raise self.retry(exc=exc, countdown=60) Automatic retry for known exceptions New in version 4.0. Sometimes you just want to retry a task whenever a particular exception is automatically retry a task using autoretry_for argument in the task() decorator: from twitter.exceptions import FailWhaleError @app.task(autoretry_for=(FailWhaleError,)) def refresh_timeline(user): return twitter.refresh_timeline(user) This is provided as an alternative to manually handling the exceptions, and the example above will do the same as wrapping the task body in a try [https://docs.python0 码力 | 1215 页 | 1.44 MB | 1 年前3Celery v4.4.4 Documentation
retry after 1 minute raise self.retry(exc=exc, countdown=60) Automatic retry for known exceptions New in version 4.0. Sometimes you just want to retry a task whenever a particular exception is automatically retry a task using autoretry_for argument in the task() decorator: from twitter.exceptions import FailWhaleError @app.task(autoretry_for=(FailWhaleError,)) def refresh_timeline(user): return twitter.refresh_timeline(user) This is provided as an alternative to manually handling the exceptions, and the example above will do the same as wrapping the task body in a try [https://docs.python0 码力 | 1215 页 | 1.44 MB | 1 年前3Celery v4.4.6 Documentation
retry after 1 minute raise self.retry(exc=exc, countdown=60) Automatic retry for known exceptions New in version 4.0. Sometimes you just want to retry a task whenever a particular exception is automatically retry a task using autoretry_for argument in the task() decorator: from twitter.exceptions import FailWhaleError @app.task(autoretry_for=(FailWhaleError,)) def refresh_timeline(user): return twitter.refresh_timeline(user) This is provided as an alternative to manually handling the exceptions, and the example above will do the same as wrapping the task body in a try [https://docs.python0 码力 | 1216 页 | 1.44 MB | 1 年前3Celery v4.4.7 Documentation
retry after 1 minute raise self.retry(exc=exc, countdown=60) Automatic retry for known exceptions New in version 4.0. Sometimes you just want to retry a task whenever a particular exception is automatically retry a task using autoretry_for argument in the task() decorator: from twitter.exceptions import FailWhaleError @app.task(autoretry_for=(FailWhaleError,)) def refresh_timeline(user): return twitter.refresh_timeline(user) This is provided as an alternative to manually handling the exceptions, and the example above will do the same as wrapping the task body in a try [https://docs.python0 码力 | 1219 页 | 1.44 MB | 1 年前3Celery v5.0.5 Documentation
retry after 1 minute raise self.retry(exc=exc, countdown=60) Automatic retry for known exceptions New in version 4.0. Sometimes you just want to retry a task whenever a particular exception is automatically retry a task using autoretry_for argument in the task() decorator: from twitter.exceptions import FailWhaleError @app.task(autoretry_for=(FailWhaleError,)) def refresh_timeline(user): return twitter.refresh_timeline(user) This is provided as an alternative to manually handling the exceptions, and the example above will do the same as wrapping the task body in a try [https://docs.python0 码力 | 2315 页 | 2.14 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100