# Exception handling

Published articles for Exception handling.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Exception Handling in Practice

DevFeed: [Exception Handling in Practice](<https://devfeed.tech/articles/exception-handling-in-practice-18192.md>)

Original publisher: [Read original article](<https://newsletter.francofernando.com/p/exception-handling-in-practice>)

Author: Franco Fernando

Published: 2026-08-28T05:50:28Z

Content type: tutorial

Language: en

Sources: [The Polymathic Engineer](<https://devfeed.tech/sources/the-polymathic-engineer.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [patterns](<https://devfeed.tech/tags/patterns.md>)

### AI overview

An article about patterns and anti-patterns for signaling, catching, and surviving failures in code.

### Source excerpt

Patterns and anti-patterns for signaling, catching, and surviving failures in your code.

## Coroutine Essentials

DevFeed: [Coroutine Essentials](<https://devfeed.tech/articles/coroutine-essentials-25051.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-coroutines/>)

Author: author@typealias.com (Dave Leeds)

Published: 2026-08-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [coding](<https://devfeed.tech/topics/coding.md>), [Software](<https://devfeed.tech/topics/software.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [coding](<https://devfeed.tech/tags/coding.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [deferred](<https://devfeed.tech/tags/deferred.md>), [dispatcher](<https://devfeed.tech/tags/dispatcher.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [job](<https://devfeed.tech/tags/job.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [launch](<https://devfeed.tech/tags/launch.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [runblocking](<https://devfeed.tech/tags/runblocking.md>), [software](<https://devfeed.tech/tags/software.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [suspend-function](<https://devfeed.tech/tags/suspend-function.md>), [withcontext](<https://devfeed.tech/tags/withcontext.md>), [yield](<https://devfeed.tech/tags/yield.md>)

### AI overview

This tutorial introduces essential Kotlin coroutine concepts for performing multiple tasks concurrently, such as making network calls while updating a screen. It aims to provide a foundation for day-to-day coding and more advanced coroutine concepts.

### Source excerpt

When you're on hold during a phone call, you might also check your email. While brewing coffee, you might also cook breakfast. And while driving a car, you might listen to a podcast. In the same way, sometimes it's helpful for the software that we write to do more than one thing at a time. For example, it could make two or three network calls at one time--all while updating the screen to show the progress of each call.

## Wastrel Compiles Hoot Scheme-to-WebAssembly Output

DevFeed: [Wastrel Compiles Hoot Scheme-to-WebAssembly Output](<https://devfeed.tech/articles/wastrelly-wabbits-35034.md>)

Original publisher: [Read original article](<https://wingolog.org/archives/2026/03/31/wastrelly-wabbits>)

Author: Andy Wingo

Published: 2026-03-31T20:34:23Z

Content type: article

Language: en

Sources: [wingolog](<https://devfeed.tech/sources/wingolog.md>)

Topics: [WebAssembly](<https://devfeed.tech/topics/web-assembly.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [scheme](<https://devfeed.tech/topics/scheme.md>)

Tags: [accidentally-quadratic](<https://devfeed.tech/tags/accidentally-quadratic.md>), [aot](<https://devfeed.tech/tags/aot.md>), [bigint](<https://devfeed.tech/tags/bigint.md>), [bignums](<https://devfeed.tech/tags/bignums.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [gc](<https://devfeed.tech/tags/gc.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [gmp](<https://devfeed.tech/tags/gmp.md>), [hoot](<https://devfeed.tech/tags/hoot.md>), [igalia](<https://devfeed.tech/tags/igalia.md>), [library](<https://devfeed.tech/tags/library.md>), [maps](<https://devfeed.tech/tags/maps.md>), [precision](<https://devfeed.tech/tags/precision.md>), [scheme](<https://devfeed.tech/tags/scheme.md>), [standard](<https://devfeed.tech/tags/standard.md>), [tail-calls](<https://devfeed.tech/tags/tail-calls.md>), [wasm](<https://devfeed.tech/tags/wasm.md>), [wastrel](<https://devfeed.tech/tags/wastrel.md>), [webassembly](<https://devfeed.tech/tags/webassembly.md>), [whippet](<https://devfeed.tech/tags/whippet.md>)

### AI overview

The article describes recent work on Wastrel, an ahead-of-time WebAssembly compiler, including compiling output from the Hoot Scheme-to-Wasm compiler. It covers implementing bignum operations with mini-gmp and updating Hoot to use standardized WebAssembly exception handling.

### Source excerpt

Good day! Today (tonight), some notes on the last couple months of Wastrel, my ahead-of-time WebAssembly compiler. Back in the beginning of February, I showed Wastrel running programs that use garbage collection, using an embedded copy of the Whippet collector, specialized to the types present in the Wasm program. But, the two synthetic GC-using programs I tested on were just ported microbenchmarks, and didn't reflect the output of any real toolchain. In this cycle I worked on compiling the output from the Hoot Scheme-to-Wasm compiler. There were some interesting challenges! bignums When I originally wrote the Hoot compiler, it targetted the browser, which already has a bignum implementation in the form of BigInt, which I worked on back in the day. Hoot-generated Wasm files use host bigints via externref (though wrapped in structs to allow for hashing and identity). In Wastrel, then, I implemented the imports that implement bignum operations: addition, multiplication, and so on. I did so using mini-gmp, a stripped-down implementation of the workhorse GNU multi-precision library. At some point if bignums become important, this gives me the option to link to the full GMP instead. Bignums were the first managed data type in Wastrel that wasn't defined as part of the Wasm module itself, instead hiding behind externref, so I had to add a facility to allocate type codes to these "host" data types. More types will come in time: weak maps, ephemerons, and so on. I think bignums would be a great proposal for the Wasm standard, similar to stringref ideally (sniff!), possibly in an attenuated form. exception handling Hoot used to emit a pre-standardization form of exception handling, and hadn't gotten around to updating to the newer version that was standardized last July. I updated Hoot to emit the newer kind of exceptions, as it was easier to implement them in Wastrel that way. Some of the problems Chris Fallin contended with in Wasmtime don't apply in the Wastrel case: sinc

## From error-handling to structured concurrency

DevFeed: [From error-handling to structured concurrency](<https://devfeed.tech/articles/from-error-handling-to-structured-concurrency-21946.md>)

Original publisher: [Read original article](<https://blog.nelhage.com/post/concurrent-error-handling/>)

Author: Nelson Elhage

Published: 2026-03-23T15:30:00Z

Content type: opinion

Language: en

Sources: [Nelson Elhage](<https://devfeed.tech/sources/nelson-elhage.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Exception](<https://devfeed.tech/topics/exception.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [examples](<https://devfeed.tech/tags/examples.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>)

### AI overview

This article examines how error-handling patterns based on stack unwinding and cleanup should be adapted for concurrent programs with multiple tasks. It introduces the problem of unhandled errors in concurrent execution and compares possible behaviors when one task fails.

### Source excerpt

How should we think about error-handling in concurrent programs? In single-threaded programs, we've mostly converged on a standard pattern, with a diverse zoo of implementations and concrete patterns. When an error occurs, it is propagated up the stack until we find a stack frame which is prepared to handle it. As we do so, we unwind the stack frames in-order, giving each frame the opportunity to clean up or destroy resources as appropriate.

## Kotlin Coroutines Cancellation and Exception Handling

DevFeed: [Kotlin Coroutines Cancellation and Exception Handling](<https://devfeed.tech/articles/kotlin-coroutines-cancellation-and-exception-handling-38659.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2026_01_11_kotlin_coroutines_cancellation_and_exception_handling/>)

Published: 2026-01-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [cancellation](<https://devfeed.tech/topics/cancellation.md>), [Exception handling](<https://devfeed.tech/topics/exception-handling.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [cancellation](<https://devfeed.tech/tags/cancellation.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>)

### AI overview

This article explains why cancellation and exception handling in Kotlin coroutines are difficult, emphasizing that the concepts are distinct but coupled. It discusses the flexibility and hidden complexity of the coroutine API and introduces explanations and best practices for learning and using these mechanisms.

### Source excerpt

Cancellation and exception handling in coroutines is by far the most complex thing I've faced during my entire career. These two things are so complicated that I sometimes ask myself how people are using such a difficult-to-use framework. I read all the possible docs that I found, many different articles, video courses, and even tried to look at the code - and still, I feel that my understanding of this topic is quite bad. When reading articles, I often thought that their structure was not good and that things were not clarified in a reasonable way. Usually, articles are just a collection of examples that show how certain combinations of suspending functions or coroutine builders will work. Learning by examples is good, but they should help with understanding core concepts so that all other situations are easy to relate to what was learned.

## Simplifying Resource Management in mssql-python through Context Manager

DevFeed: [Simplifying Resource Management in mssql-python through Context Manager](<https://devfeed.tech/articles/simplifying-resource-management-in-mssql-python-through-context-manager-20355.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/python/simplifying-resource-management-in-mssql-python-through-context-manager/>)

Author: Jahnvi Thakkar

Published: 2025-09-26T09:49:51Z

Content type: tutorial

Language: en

Sources: [Microsoft Python Engineering](<https://devfeed.tech/sources/microsoft-python-engineering.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [sql-server](<https://devfeed.tech/topics/sql-server.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Exception](<https://devfeed.tech/topics/exception.md>)

Tags: [azure](<https://devfeed.tech/tags/azure.md>), [azure-sql](<https://devfeed.tech/tags/azure-sql.md>), [cleanup](<https://devfeed.tech/tags/cleanup.md>), [client-driver](<https://devfeed.tech/tags/client-driver.md>), [databases](<https://devfeed.tech/tags/databases.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [python](<https://devfeed.tech/tags/python.md>), [python-driver-for-azure-sql](<https://devfeed.tech/tags/python-driver-for-azure-sql.md>), [python-driver-for-sql-server](<https://devfeed.tech/tags/python-driver-for-sql-server.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [sql-server-2025](<https://devfeed.tech/tags/sql-server-2025.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

### AI overview

This tutorial explains context manager support in the mssql-python driver for Python applications using SQL Server and Azure SQL. It describes how context managers manage connections and cursors, commit successful transactions, roll back transactions when exceptions occur, and close connections automatically.

### Source excerpt

Reviewed by: Sumit Sarabhai and Gaurav Sharma If you've worked with databases in Python, you know the boilerplate: open a connection, create a cursor, run queries, commit or rollback transactions, close cursors and connection. Forgetting just one cleanup step can lead to resource leaks (open connections) or even inconsistent data. That's where context managers step [...] The post Simplifying Resource Management in mssql-python through Context Manager appeared first on Microsoft for Python Developers Blog.

## ESP-IDF error handling in FreeRTOS-based embedded applications

DevFeed: [ESP-IDF error handling in FreeRTOS-based embedded applications](<https://devfeed.tech/articles/esp-idf-tutorial-series-errors-13718.md>)

Original publisher: [Read original article](<https://developer.espressif.com/blog/2025/08/errors_and_logging/>)

Author: John Lee

Published: 2025-08-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [Blog on Developer Portal](<https://devfeed.tech/sources/blog-on-developer-portal.md>)

Topics: [ESP-IDF](<https://devfeed.tech/topics/esp-idf.md>), [C](<https://devfeed.tech/topics/c.md>), [Embedded Systems](<https://devfeed.tech/topics/embedded-systems.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [Embedded Software Dev](<https://devfeed.tech/topics/embedded-software-dev.md>), [real-time](<https://devfeed.tech/topics/real-time.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [c](<https://devfeed.tech/tags/c.md>), [embedded](<https://devfeed.tech/tags/embedded.md>), [embedded-systems](<https://devfeed.tech/tags/embedded-systems.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [errors](<https://devfeed.tech/tags/errors.md>), [esp-idf](<https://devfeed.tech/tags/esp-idf.md>), [esp32c3](<https://devfeed.tech/tags/esp32c3.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [freertos](<https://devfeed.tech/tags/freertos.md>), [logging](<https://devfeed.tech/tags/logging.md>), [real-time](<https://devfeed.tech/tags/real-time.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

This tutorial explains error handling in FreeRTOS-based embedded systems. It reviews C techniques such as return codes and global error indicators, then introduces ESP-IDF's esp_err_t type and error-checking macros for more systematic error management.

### Source excerpt

This article explains error handling in FreeRTOS-based embedded systems, highlighting common C practices and their limitations. It introduces ESP-IDF's esp_err_t type and error-checking macros, demonstrating how they help manage errors systematically. It shows practical ways to implement error handling in embedded applications.

## Finally, You Can Drop the Parentheses in Python 3.14

DevFeed: [Finally, You Can Drop the Parentheses in Python 3.14](<https://devfeed.tech/articles/finally-you-can-drop-the-parentheses-in-python-3-14-20.md>)

Original publisher: [Read original article](<https://blog.abhimanyu-saharan.com/posts/finally-you-can-drop-the-parentheses-in-python-3-14>)

Author: Abhimanyu Saharan

Published: 2025-05-25T00:00:00Z

Content type: article

Language: en

Sources: [Abhimanyu Saharan](<https://devfeed.tech/sources/abhimanyu-s-blog.md>)

Topics: [Python 3.14](<https://devfeed.tech/topics/python-3-14.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [python](<https://devfeed.tech/tags/python.md>), [python-3-14](<https://devfeed.tech/tags/python-3-14.md>)

### AI overview

Python 3.14 introduces a cleaner syntax for catching multiple exceptions by allowing the parentheses to be omitted, as specified in PEP 758.

### Source excerpt

Python 3.14 simplifies exception handling with PEP 758, letting you drop parentheses when catching multiple exceptions, cleaner, consistent, and backward-safe.

## Coroutines Mastery

DevFeed: [Coroutines Mastery](<https://devfeed.tech/articles/coroutines-mastery-39258.md>)

Original publisher: [Read original article](<https://kt.academy/article/coroutines-mastery>)

Published: 2025-05-23T00:00:00Z

Content type: article

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Exception handling](<https://devfeed.tech/topics/exception-handling.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [Back end](<https://devfeed.tech/topics/backend.md>)

Tags: [2025](<https://devfeed.tech/tags/2025.md>), [android](<https://devfeed.tech/tags/android.md>), [backend](<https://devfeed.tech/tags/backend.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [testing](<https://devfeed.tech/tags/testing.md>), [workshop](<https://devfeed.tech/tags/workshop.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

Coroutines Mastery is a five-week, self-paced Kotlin Coroutines course with video lessons, exercises, twice-weekly live Q&A sessions, and platform discussions. It covers topics including debugging, testing, exception handling, and synchronization issues, and is intended for Kotlin Coroutines users from beginners to advanced developers.

### Source excerpt

5-weeks-long kohort workshop to master Kotlin Coroutines.

## Kotlin Exception Handling: Why Singleton Exceptions are a bad idea

DevFeed: [Kotlin Exception Handling: Why Singleton Exceptions are a bad idea](<https://devfeed.tech/articles/kotlin-exception-handling-why-singleton-exceptions-are-a-bad-idea-25732.md>)

Original publisher: [Read original article](<https://blog.shreyaspatil.dev/kotlin-exception-handling-why-singleton-exceptions-are-a-bad-idea/>)

Author: Shreyas Patil

Published: 2024-09-18T12:56:49Z

Content type: tutorial

Language: en

Sources: [Shreyas Patil's Blog](<https://devfeed.tech/sources/shreyas-patil-s-blog.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [App](<https://devfeed.tech/topics/app.md>), [Crashlytics](<https://devfeed.tech/topics/crashlytics.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [coding](<https://devfeed.tech/tags/coding.md>), [crashlytics](<https://devfeed.tech/tags/crashlytics.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [errors](<https://devfeed.tech/tags/errors.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [exceptionhandling](<https://devfeed.tech/tags/exceptionhandling.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [java](<https://devfeed.tech/tags/java.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-beginner](<https://devfeed.tech/tags/kotlin-beginner.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [mistakes](<https://devfeed.tech/tags/mistakes.md>), [programming-blogs](<https://devfeed.tech/tags/programming-blogs.md>), [programming-tips](<https://devfeed.tech/tags/programming-tips.md>)

### AI overview

This Kotlin micro-blog explains why singleton exception instances can produce incorrect stack traces and mislead debugging. It recommends avoiding singleton exceptions when stack traces matter, while noting they may be acceptable for internal state or informational exceptions that are not monitored at scale.

### Source excerpt

Understand why using singleton exceptions in Kotlin can be a bad practice and how it affects stack traces and debugging in your applications.

## Handling Runtime Exceptions

DevFeed: [Handling Runtime Exceptions](<https://devfeed.tech/articles/handling-runtime-exceptions-25055.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-exceptions/>)

Author: author@typealias.com (Dave Leeds)

Published: 2024-02-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [custom-exceptions](<https://devfeed.tech/tags/custom-exceptions.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [exception-types-in-kotlin](<https://devfeed.tech/tags/exception-types-in-kotlin.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-programming](<https://devfeed.tech/tags/kotlin-programming.md>), [kotlin-throw-keyword](<https://devfeed.tech/tags/kotlin-throw-keyword.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [runtime-errors](<https://devfeed.tech/tags/runtime-errors.md>), [try-catch-blocks](<https://devfeed.tech/tags/try-catch-blocks.md>)

### AI overview

This Kotlin tutorial explains runtime exceptions, contrasting runtime problems with compile-time errors and introducing how to handle unexpected problems while a program runs.

### Source excerpt

In real life, when we decide to do something, we primarily think in terms of a successful experience. For example, if you're driving to your friend's house for dinner, you might look up the directions on a mapping app, make sure you've got enough gasoline in the car, and leave at the right time in order to arrive when dinner is hot. If everything goes according to plan, you'll arrive on time.

## Exceptional Exception Handling

DevFeed: [Exceptional Exception Handling](<https://devfeed.tech/articles/exceptional-exception-handling-23848.md>)

Original publisher: [Read original article](<http://testing.googleblog.com/2023/12/exceptional-exception-handling.html>)

Author: Google Testing Bloggers (noreply@blogger.com)

Published: 2023-12-05T13:19:00Z

Content type: tutorial

Language: en

Sources: [Google Testing Blog](<https://devfeed.tech/sources/google-testing-blog.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Java](<https://devfeed.tech/topics/java.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [code-health](<https://devfeed.tech/tags/code-health.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [java](<https://devfeed.tech/tags/java.md>), [tott](<https://devfeed.tech/tags/tott.md>), [yiming-sun](<https://devfeed.tech/tags/yiming-sun.md>)

### AI overview

This article explains how oversized exception-handling blocks can obscure program logic, catch unintended exceptions, and lose root-cause information. Using Java examples, it recommends narrowing the try block, catching the specific exception, and preserving the original cause when rethrowing.

### Source excerpt

This is another post in our Code Health series. A version of this post originally appeared in Google bathrooms worldwide as a Google Testing on the Toilet episode. You can download a printer-friendly version to display in your office. by Yiming Sun Have you ever seen huge exception-handling blocks? Here is an example in Java, although you may have seen similar problems in Python, TypeScript, Kotlin, or any language that supports exceptions. Let's assume we are calling bakePizza() to bake a pizza, and it can be overbaked, throwing a PizzaOverbakedException. class PizzaOverbakedException extends Exception {}; void bakePizza () throws PizzaOverbakedException {}; try { // 100+ lines of code to prepare pizza ingredients. ... bakePizza(); // Another 100+ lines of code to deliver pizza to a customer. ... } catch (Exception e) { throw new IllegalStateException(); // Root cause ignored while throwing new exception. } Here are the problems with the above code: Obscuring the logic. The method bakePizza(), is obscured by the additional lines of code of preparation and delivery, so unintended exceptions from preparation and delivery may be caught. Catching the general exception. catch (Exception e) will catch everything, despite that we might only want to handle PizzaOverbakedException here. Rethrowing a general exception, with the original exception ignored. This means that the root cause is lost - we don't know what exactly goes wrong with pizza baking while debugging. Here is a better alternative, rewritten to avoid the problems above. class PizzaOverbakedException extends Exception {}; void bakePizza () throws PizzaOverbakedException {}; // 100+ lines of code to prepare pizza ingredients. ... try { bakePizza(); } catch (PizzaOverbakedException e) { // Other exceptions won't be caught. // Rethrow a more meaningful exception; so that we know pizza is overbaked. throw new IllegalStateException("You burned the pizza!", e); } // Another 100+ lines of code to deliver pizza to a cu

## I know Nothing in Kotlin

DevFeed: [I know Nothing in Kotlin](<https://devfeed.tech/articles/i-know-nothing-in-kotlin-23971.md>)

Original publisher: [Read original article](<https://medium.com/making-meetup/i-know-nothing-in-kotlin-392a85bcc3b4?source=rss----6981e268ba45---4>)

Author: Colin Lee

Published: 2022-09-16T15:32:41Z

Content type: tutorial

Language: en

Sources: [Making Meetup - Medium](<https://devfeed.tech/sources/making-meetup-medium.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Swift](<https://devfeed.tech/topics/swift.md>)

Tags: [coroutines](<https://devfeed.tech/tags/coroutines.md>), [dns](<https://devfeed.tech/tags/dns.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform-mobile](<https://devfeed.tech/tags/kotlin-multiplatform-mobile.md>), [network](<https://devfeed.tech/tags/network.md>), [nothing](<https://devfeed.tech/tags/nothing.md>), [refactor](<https://devfeed.tech/tags/refactor.md>), [swift](<https://devfeed.tech/tags/swift.md>), [timeout](<https://devfeed.tech/tags/timeout.md>)

### AI overview

This article explains Kotlin's Nothing type through a code-pairing example involving repository calls in a shared Kotlin Multiplatform Mobile module. It describes refactoring repeated exception handling, rethrowing CancellationExceptions for cooperative coroutine cancellation, and using Nothing for functions that always throw.

### Source excerpt

When the Greek philosopher Socrates professed that "I know only one thing -- that I know nothing," he wasn't exactly professing ignorance. It was an ancient formulation of the Dunning-Kruger effect. He had discovered that the more he learned, the wider the expanse of human knowledge seemed and the less that it seemed he knew. A fool, on the other hand, might believe that they're "not smart, but genius... and a very stable genius at that," and that they know "only the best words." In this sense, it's a good thing to know nothing. It's also true in Kotlin. During a recent code pairing session, I discovered that in Kotlin, there are numerous developers who have written code in the language for many years. And yet, they still don't know Nothing. Our pairing session became a big fuss about Nothing. We were working on some Repository code in our shared Kotlin Multiplatform Mobile (KMM) module of our Meetup for Organizers app. In this code, there was a repeated block at the end of every repository call to handle network, DNS, and timeout errors. We decided it would make sense to refactor this block into a function as we used it so often. The repeated block in question handled a catch block. It had to re-throw any CancellationExceptions to allow cooperative cancellation of coroutines. Then we had to wrap any other exception and re-throw it as a custom exception type so that we can easily tell iOS a complete list of all types we intend to throw in a @Throws declaration. This allows exception handling and avoids crashing when our functions are called by Swift code. In essence, this code block always threw an Exception. The pairing session became quite funny, like the Laurel and Hardy "Who's on First" comedy routine, but you could tell there was Nothing more frustrating, too. It went something like this: "Why am I getting this red text at the call site?" "The return type is incorrect because you always throw an exception. You need to return Nothing." "I already am returning nothi

## I Know Nothing in Kotlin

DevFeed: [I Know Nothing in Kotlin](<https://devfeed.tech/articles/i-know-nothing-in-kotlin-37554.md>)

Original publisher: [Read original article](<https://colintheshots.com/writing/i-know-nothing-in-kotlin/>)

Published: 2022-08-30T17:52:35Z

Content type: tutorial

Language: en

Sources: [Colin The Shots](<https://devfeed.tech/sources/colin-the-shots.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [kotlin multiplatform mobile](<https://devfeed.tech/topics/kotlin-multiplatform-mobile.md>)

Tags: [coroutines](<https://devfeed.tech/tags/coroutines.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform-mobile](<https://devfeed.tech/tags/kotlin-multiplatform-mobile.md>), [refactor](<https://devfeed.tech/tags/refactor.md>)

### AI overview

This developer article explains Kotlin's Nothing type through a refactoring example involving exception handling in a shared Kotlin Multiplatform Mobile repository. It distinguishes Nothing from Unit and describes using it when a function always throws, including when interoperating with Swift code and preserving coroutine cancellation.

### Source excerpt

When the Greek philosopher Socrates professed that "I know only one thing-- that I know nothing," he wasn't exactly professing ignorance. It was an ancient formulation of the Dunning-Kruger effect.

## Making unwinding through JIT-ed code scalable - Optimistic Lock Coupling

DevFeed: [Making unwinding through JIT-ed code scalable - Optimistic Lock Coupling](<https://devfeed.tech/articles/making-unwinding-through-jit-ed-code-scalable-optimistic-lock-coupling-25079.md>)

Original publisher: [Read original article](<https://databasearchitects.blogspot.com/2022/06/optimisticlockcoupling.html>)

Author: Thomas Neumann (noreply@blogger.com)

Published: 2022-06-26T08:52:00Z

Content type: article

Language: en

Sources: [Database Architects](<https://devfeed.tech/sources/database-architects.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [locking](<https://devfeed.tech/tags/locking.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [performance](<https://devfeed.tech/tags/performance.md>), [set](<https://devfeed.tech/tags/set.md>)

### AI overview

The article explains a scalable approach to unwinding through JIT-ed code using a read-optimized B-tree with optimistic lock coupling. Writers use conventional exclusive lock coupling, while readers use version locks and validate their reads so they can run in parallel when writes are uncommon.

### Source excerpt

This article is part of the series about scalable unwinding that starts here. When thinking about exception handling it is reasonable to assume that we will have far more unwinding requests than changes to the unwinding tables. In our setup, the tables only change when JITed code is added to or removed from the program. That is always expensive to begin with due the mprotect calls, TLB shootdowns, etc. Thus we can safely assume that we will have at most a few hundred updates per second even in extreme cases, probably far less. Lookups however can easily reach thousands or even millions per second, as we do one lookup per frame. This motivates us to use a read-optimized data structure, a b-tree with optimistic lock coupling: Writers use traditional lock coupling (lock parent node exclusive, lock child node exclusive, release parent node, lock child of child, etc.), which works fine as long as there is not too much contention. Readers however have to do something else, as we expect thousands of them. One might be tempted to use a rw-lock for readers, but that does not help. Locking an rw-lock in shared mode causes an atomic write, which makes the threads fight over the cache line of the lock even if there is no (logical) contention. Instead, we use version locks, where readers do no write at all: // Common logic for version locks struct version_lock { // The lock itself. The lowest bit indicates an exclusive lock, // the second bit indicates waiting threads. All other bits are // used as counter to recognize changes. // Overflows are okay here, we must only prevent overflow to the // same value within one lock_optimistic/validate // range. Even on 32 bit platforms that would require 1 billion // frame registrations within the time span of a few assembler // instructions. uintptr_t version_lock; }; #ifdef __GTHREAD_HAS_COND // We should never get contention within the tree as it rarely changes. // But if we ever do get contention we use these for waiting static __gthre

## In-Process Patchless AMSI Bypass

DevFeed: [In-Process Patchless AMSI Bypass](<https://devfeed.tech/articles/in-process-patchless-amsi-bypass-32633.md>)

Original publisher: [Read original article](<https://ethicalchaos.dev/2022/04/17/in-process-patchless-amsi-bypass/>)

Author: CCob

Published: 2022-04-17T16:30:25Z

Content type: tutorial

Language: en

Sources: [Ethical Chaos](<https://devfeed.tech/sources/ethical-chaos.md>)

Topics: [Windows](<https://devfeed.tech/topics/windows.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [exceptions](<https://devfeed.tech/topics/exceptions.md>), [debug](<https://devfeed.tech/topics/debug.md>), [C2](<https://devfeed.tech/topics/c2.md>), [Processes](<https://devfeed.tech/topics/processes.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [breakpoint](<https://devfeed.tech/tags/breakpoint.md>), [bypass](<https://devfeed.tech/tags/bypass.md>), [c2](<https://devfeed.tech/tags/c2.md>), [context](<https://devfeed.tech/tags/context.md>), [debugger](<https://devfeed.tech/tags/debugger.md>), [edr](<https://devfeed.tech/tags/edr.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [execution](<https://devfeed.tech/tags/execution.md>), [extension](<https://devfeed.tech/tags/extension.md>), [windows](<https://devfeed.tech/tags/windows.md>)

### AI overview

This article explains an in-process, patchless AMSI bypass approach using vectored exception handling. It contrasts this technique with SharpBlock's debugger-based child-process method and describes manipulating thread context at the point an exception occurs.

### Source excerpt

Some of you may remember my patchless AMSI bypass article and how it was used inside SharpBlock to bypass AMSI on the child process that SharpBlock spawns. This is all well a good when up against client environments that are not too sensitive to the fork and run post exploitation model of operating. What about [...] The post In-Process Patchless AMSI Bypass appeared first on Ethical Chaos.

## Kotlin Coroutines Exception Handling Cheat Sheet

DevFeed: [Kotlin Coroutines Exception Handling Cheat Sheet](<https://devfeed.tech/articles/kotlin-coroutines-exception-handling-cheat-sheet-25415.md>)

Original publisher: [Read original article](<https://www.lukaslechner.com/coroutines-exception-handling-cheat-sheet/>)

Author: Lukas Lechner

Published: 2020-10-28T14:12:43Z

Content type: article

Language: en

Sources: [Lukas Lechner](<https://devfeed.tech/sources/lukas-lechner.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [allgemein](<https://devfeed.tech/tags/allgemein.md>), [allgemein-kotlin](<https://devfeed.tech/tags/allgemein-kotlin.md>), [cheat-sheet](<https://devfeed.tech/tags/cheat-sheet.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>)

### AI overview

A cheat sheet explains six key points about exception handling in Kotlin coroutines, including try-catch handling, exception propagation through job hierarchies, differences between launch and async, coroutineScope behavior, and cancellation exceptions.

### Source excerpt

Exception Handling with Kotlin Coroutines is hard. I wrote an extensive article about it and gave talks about it at several conferences. Some developers suggested creating some kind of cheat sheet that could be helpful for implementing appropriate exception handling in coroutine-based code. Here it is 😉. It contains the six most important points. You Read More The post Kotlin Coroutines Exception Handling Cheat Sheet first appeared on Lukas Lechner.

## Kotlin and Exceptions

DevFeed: [Kotlin and Exceptions](<https://devfeed.tech/articles/kotlin-and-exceptions-26024.md>)

Original publisher: [Read original article](<https://elizarov.medium.com/kotlin-and-exceptions-8062f589d07?source=rss-4762e889f8fc------2>)

Author: Roman Elizarov

Published: 2020-06-10T08:18:06Z

Content type: article

Language: en

Sources: [Stories by Roman Elizarov on Medium](<https://devfeed.tech/sources/stories-by-roman-elizarov-on-medium.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Java](<https://devfeed.tech/topics/java.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [api-design](<https://devfeed.tech/tags/api-design.md>), [code](<https://devfeed.tech/tags/code.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>)

### AI overview

The article examines Kotlin exceptions by tracing their origins to Java checked exceptions. It explains how checked exceptions were intended to reduce missed error checks, then discusses problems including boilerplate, overly broad API declarations, ignored exceptions, and poor compatibility with Java 8 lambdas and streams.

### Source excerpt

Photo by John Mark Arnold on Unsplash What are Kotlin Exceptions and how should you use them? To figure it out let's look at their origins first. Exceptions came to Kotlin from Java. The story with exceptions in Java is complicated, though. I'll give a brief overview. The Origin Java has a unique concept of checked exceptions that were designed to solve the problem of verbose and error-prone error-handling (pun intended). In languages predating Java, like in venerable C, you have to write code like shown in this snippet when doing basic input/output: file = fopen("file.txt", "r"); if (file == NULL) { // handle error & return } // work with file, check for error after each file operation Every time you perform an operation that might fail due to some external circumstance, which happens especially often with files and network, you have to write code that checks the corresponding error condition and handles it. That's tedious, easy to forget, hard to debug. Java set on a noble goal to eliminate this problem. The solution was to use checked exceptions. Every file I/O operation is declared as throws IOException in Java and the compiler checks that you either handle it or declare that you rethrow it. The beauty of this is that you can write exception-handling code once for a whole bunch of I/O operations and you cannot forget writing it since the Java compiler is there to help you. file = FileInputStream("file.txt"); // throws IOException No error-handling boilerplate, no more missed error checks. It was such a bliss to program in Java... for a while. Problems Problems with checked exceptions accumulated over the years. Memory input/output APIs like ByteArrayInputStream were still declared to throw IOException that you had to handle even though it never happened, people abused checked exceptions in API design leading to long, contagious lists of thrown exceptions, developers routinely caught and ignored checked exceptions just to fit some exception-throwing API under an in

## Functional Hangman in Kotlin with Arrow (part 2)

DevFeed: [Functional Hangman in Kotlin with Arrow (part 2)](<https://devfeed.tech/articles/functional-hangman-in-kotlin-with-arrow-part-2-25868.md>)

Original publisher: [Read original article](<http://lordraydenmk.github.io//2018/functional-hangman-in-kotlin-with-arrow-part-2/>)

Author: Stojan Anastasov

Published: 2018-12-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stojan Anastasov's blog](<https://devfeed.tech/sources/stojan-anastasov-s-blog.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [IO](<https://devfeed.tech/topics/io.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>)

Tags: [arrowkt](<https://devfeed.tech/tags/arrowkt.md>), [code](<https://devfeed.tech/tags/code.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [fp](<https://devfeed.tech/tags/fp.md>), [functional](<https://devfeed.tech/tags/functional.md>), [io](<https://devfeed.tech/tags/io.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>)

### AI overview

This tutorial explains the second part of converting a functional Hangman game from Scala with ZIO to Kotlin with Arrow. It replaces a hard-coded IO data type with a polymorphic design using Kind and introduces MonadDefer to represent capabilities such as lazy evaluation, exception handling, and completion with a result.

### Source excerpt

Converting a Functional Hangman game from Scala (ZIO) to Kotlin (with Arrow) was a nice exercise. I enjoyed working on it and I learned a lot. When I asked for feedback on the #arrow channel, one of the maintainers, Leandro had an interesting suggestion. Instead of hard-coding the data type IO I should try and make the program polymorphic and use Kind instead. That means writing the code focusing on the domain logic, using abstractions, and deferring the decision for the concrete data type like IO or Single (from RxJava) until the main function. The journey I was not familiar with that style of programming so I used this example from the excellent Arrow documentation as a guide. Writing to the the console In the previous article I used IO<A> to interact with the console. IO<A> represents an operation that can be executed lazily, fail with an exception (the exception is captured inside IO), run forever or return a single A. Let's take a look at the original implementation: fun putStrLn(line: String): IO<Unit> = IO { println(line) } // Usage in main() putStrLn("Hello world!").unsafeRunSync() putStrLn is a function that take a String and return a IO<Unit>. IO takes a lambda that is lazily evaluated at the end of the world, when we call unsafeRunSync(). If we want to achieve the same thing with Single we could use Single.fromCallable wrap our lambda and evaluate it in the main function when we call subscribe(). fun putStrLn(line: String): Single<Unit> = Single.fromCallable { println(line) } // Usage in main() putStrLn("Hello World").subscribe() Here bothIO and Single have something in common. A set of capabilities like: lazy evaluation, exception handling, and running forever or completing with a result of type A. IO and Single do a lot more, but for this use case, we want something as simple as possible that has the same capabilities. There is a type-class in Arrow that can do just that and it's called MonadDefer(more info). After a few iterations, and feedback from th

## Debugger data model, Javascript & x64 exception handling

DevFeed: [Debugger data model, Javascript & x64 exception handling](<https://devfeed.tech/articles/debugger-data-model-javascript-x64-exception-handling-39703.md>)

Original publisher: [Read original article](<https://doar-e.github.io/blog/2017/12/01/debugger-data-model/>)

Author: Axel "0vercl0k" Souchet

Published: 2017-12-01T14:59:00Z

Content type: tutorial

Language: en

Sources: [Diary of a reverse-engineer](<https://devfeed.tech/sources/diary-of-a-reverse-engineer.md>)

Topics: [debugging](<https://devfeed.tech/topics/debugging.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Exception handling](<https://devfeed.tech/topics/exception-handling.md>), [Microsoft](<https://devfeed.tech/topics/microsoft.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [Reverse Engineering](<https://devfeed.tech/topics/reverse-engineering.md>)

Tags: [debugging](<https://devfeed.tech/tags/debugging.md>), [debugging-tools](<https://devfeed.tech/tags/debugging-tools.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [microsoft](<https://devfeed.tech/tags/microsoft.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>), [seh](<https://devfeed.tech/tags/seh.md>), [time-travel-debugging](<https://devfeed.tech/tags/time-travel-debugging.md>), [ttd](<https://devfeed.tech/tags/ttd.md>), [windbg](<https://devfeed.tech/tags/windbg.md>)

### AI overview

This tutorial explores the WinDbg Preview debugger data model, JavaScript extensions, and Microsoft's time travel debugging tools. It explains how these features can be used to enumerate x64 try/except handlers in JavaScript.

### Source excerpt

Introduction The main goal of today's post is to show a bit more of what is now possible with the latest Windbg (currently branded "WinDbg Preview" in the Microsoft store) and the time travel debugging tools that Microsoft released a few months ago. When these finally got released, a bit ...

## Working With APIs the Pythonic Way

DevFeed: [Working With APIs the Pythonic Way](<https://devfeed.tech/articles/working-with-apis-the-pythonic-way-33946.md>)

Original publisher: [Read original article](<https://hakibenita.com/working-with-apis-the-pythonic-way>)

Author: Haki Benita

Published: 2017-01-04T22:00:00Z

Content type: tutorial

Language: en

Sources: [Haki Benita](<https://devfeed.tech/sources/haki-benita.md>)

Topics: [API](<https://devfeed.tech/topics/api.md>), [Python](<https://devfeed.tech/topics/python.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [apis](<https://devfeed.tech/tags/apis.md>), [articles](<https://devfeed.tech/tags/articles.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [django](<https://devfeed.tech/tags/django.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [http](<https://devfeed.tech/tags/http.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [logging](<https://devfeed.tech/tags/logging.md>), [python](<https://devfeed.tech/tags/python.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

A step-by-step tutorial on building a Python module for communicating with an external payment gateway. It covers handling HTTP and remote payment errors, defining custom exceptions, logging, and returning structured charge responses with namedtuple.

### Source excerpt

Communication with external services is an integral part of any modern system. Whether it's a payment service, authentication, analytics or an internal one - systems need to talk to each other. In this short article we are going to implement a module for communicating with a made-up payment gateway, step by step.

## Checked vs. Unchecked Exceptions in Java: A Historical Perspective and Comparison

DevFeed: [Checked vs. Unchecked Exceptions in Java: A Historical Perspective and Comparison](<https://devfeed.tech/articles/checked-vs-unchecked-exceptions-in-java-why-it-s-so-confusing-24997.md>)

Original publisher: [Read original article](<https://codeahoy.com/java/2016/04/02/checked-vs-unchecked-exceptions-in-java/>)

Author: umer

Published: 2016-04-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Code Ahoy - Articles](<https://devfeed.tech/sources/code-ahoy-articles.md>)

Topics: [Exception](<https://devfeed.tech/topics/exception.md>), [Java](<https://devfeed.tech/topics/java.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [C](<https://devfeed.tech/topics/c.md>), [Lisp](<https://devfeed.tech/topics/lisp.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [java](<https://devfeed.tech/tags/java.md>), [lisp](<https://devfeed.tech/tags/lisp.md>)

### AI overview

A tutorial for new Java developers that explains the historical motivation for Java's exception-handling mechanism and examines the debate between checked and unchecked exceptions, contrasting them with error-code patterns in C.

### Source excerpt

This blog post is intended for new Java developers. It starts with a historical perspective and a look at what motivated the design and creation of Java's exception handling mechanism. It also explores the hotly debated checked vs unchecked exceptions debate with some personal insights. Let's start. Historical Perspective Back in the time of the "C" programming language, it was customary to return values such as -1 or NULL from functions to indicate errors. This was practical for small applications but didn't scale well for larger applications - developers had to check and track every possible return value: a return value of 2 might indicate "host is down" error in library A whereas in library B, it could mean "illegal filename". Although, developers tried to fix this and attempts were made to standardize error codes by setting global variables, but it didn't help much. #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Argument list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM 12 /* Out of memory */ James Gosling and other designers felt that a similar approach would go against the design goals of Java programming language. They wanted: a cleaner, robust and portable approach built-in language support for error checking and handling. Essentially, one of their main design goals was to build a language that's robust and able to cope with errors during execution or at least recognize when going go wrong. This principle is at the core of Java's error handling design, as we'll see later. James Gosling explains in one of his interviews: One of the traditional things to screw up in C code is opening a data file to read. It's semi-traditional in the C world to

## Handling crashes on Mac OS X: ordering of Mach exceptions versus POSIX signals

DevFeed: [Handling crashes on Mac OS X: ordering of Mach exceptions versus POSIX signals](<https://devfeed.tech/articles/handling-crashes-on-mac-os-x-ordering-of-mach-exceptions-versus-posix-signals-21565.md>)

Original publisher: [Read original article](<http://lackingrhoticity.blogspot.com/2013/08/handling-crashes-on-mac-os-x.html>)

Author: Mark Seaborn (noreply@blogger.com)

Published: 2013-08-07T20:25:00Z

Content type: tutorial

Language: en

Sources: [Mark Seaborn](<https://devfeed.tech/sources/mark-seaborn.md>)

Topics: [Operating system](<https://devfeed.tech/topics/operating-system.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>), [Processes](<https://devfeed.tech/topics/processes.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [POSIX](<https://devfeed.tech/topics/posix.md>), [out-of-process](<https://devfeed.tech/topics/out-of-process.md>), [Remote Procedure Call (RPC)](<https://devfeed.tech/topics/rpc.md>)

Tags: [crash](<https://devfeed.tech/tags/crash.md>), [dialog](<https://devfeed.tech/tags/dialog.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [experimentation](<https://devfeed.tech/tags/experimentation.md>), [handler](<https://devfeed.tech/tags/handler.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [mac](<https://devfeed.tech/tags/mac.md>), [mac-os](<https://devfeed.tech/tags/mac-os.md>), [memory](<https://devfeed.tech/tags/memory.md>), [ordering](<https://devfeed.tech/tags/ordering.md>), [os](<https://devfeed.tech/tags/os.md>), [out-of-process](<https://devfeed.tech/tags/out-of-process.md>), [posix](<https://devfeed.tech/tags/posix.md>), [process](<https://devfeed.tech/tags/process.md>), [processes](<https://devfeed.tech/tags/processes.md>), [rpc](<https://devfeed.tech/tags/rpc.md>), [signal](<https://devfeed.tech/tags/signal.md>)

### AI overview

This article explains how Mac OS X handles hardware exceptions through POSIX signals and Mach exceptions. It reports that Mach exception handlers receive priority, while the kernel uses a first-chance Mach handler, a POSIX signal handler, and a second-chance Mach handler when handling faults and crashes.

### Source excerpt

Mac OS X is a curious operating system because its kernel is derived from two kernel codebases -- the Mach kernel and a BSD kernel -- that have been glued together. From these two ancestors, OS X inherits two different mechanisms for processes to handle hardware exceptions (a.k.a. faults): POSIX signals: In-process only. Registered per-process. The handler is always called on the thread that produced the fault. Mach exceptions: Allow both in-process and out-of-process handling. Can be registered per-thread and per-process. The handler is invoked via Mach RPC. On OS X, it's possible for a process to have both POSIX signal handlers and Mach exception handlers registered. It's not immediately obvious which of the two handlers will take priority and get invoked first, but experimentation shows that it's the Mach handler. If a process faults with a memory access error, the Mach exception handler for EXC_BAD_ACCESS gets invoked first, and if this handler returns KERN_FAILURE, the POSIX signal handler for SIGBUS will then be invoked. However, that's not the full story. OS X has a built-in Crash Reporter service which will create a crash dump if an application crashes and pop up a dialog box. Crash Reporter works via Mach exception handling and runs out-of-process. An application will normally have Crash Reporter's crash handler registered as one of its default Mach exception handlers. But what stops this handler from interfering with normal use of POSIX signals, if Mach exception handlers take priority over POSIX signals? The answer is that OS X's kernel has three steps for handling a hardware exception: First-chance Mach exception handler: The kernel tries to invoke the Mach exception handler registered for the type of fault that occurred, e.g. EXC_BAD_ACCESS. If there's no handler registered, it skips this step. If the handler returns KERN_SUCCESS, the kernel resumes the thread that faulted. POSIX signal handler: If the Mach exception handler was absent or returned KERN_

## C++ Name Mangling and Compiler ABI Compatibility

DevFeed: [C++ Name Mangling and Compiler ABI Compatibility](<https://devfeed.tech/articles/newsletter-81-32947.md>)

Original publisher: [Read original article](<https://reactos.org/blogs/newsletter-81/>)

Published: 2011-03-14T00:00:00Z

Content type: article

Language: en

Sources: [Front Page on ReactOS Website](<https://devfeed.tech/sources/front-page-on-reactos-website.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Specifications](<https://devfeed.tech/topics/specifications.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [ReactOS](<https://devfeed.tech/topics/reactos.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [free](<https://devfeed.tech/tags/free.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [os](<https://devfeed.tech/tags/os.md>), [react](<https://devfeed.tech/tags/react.md>), [reactos](<https://devfeed.tech/tags/reactos.md>), [specifications](<https://devfeed.tech/tags/specifications.md>), [win32](<https://devfeed.tech/tags/win32.md>), [winapi](<https://devfeed.tech/tags/winapi.md>)

### AI overview

The article explains how C++ compilers handle name mangling and exception handling, noting that these behaviors are not fully specified by the C++ standard. It describes compatibility problems when linking code built with different compilers or compiler versions, including differences between GCC, Visual Studio, and other toolchains.

### Source excerpt

C++ Mangling Those with any experience using third party libraries while writing C++ applications should quickly recognize the topic I am about to go over and can skip down to paragraph three for the ReactOS specific miseries. Those that are not familiar with the issues or want a refresher should continue. The C++ standard outlines behavior for C++ code when compiled. To be considered a compliant compiler requires following the specifications laid out, though no compiler that I am aware of actually implements 100% of the entire standard.

[Next page](<https://devfeed.tech/tags/exception-handling.md?cursor=WyIyMDExLTAzLTE0VDAwOjAwOjAwKzAwOjAwIiwgImVjYjRjMjU0LTExNjAtNGJjMC1iZmQ5LWE5NTc0NzkxY2EyNiJd>)