Exception Handling

How to Write Error Handling in Micronaut

Reading Time: 3 minutes I’m going to walk you through the process of writing error handling in Micronaut which is a very simple, but powerful way, to manage errors. Why is Error Handling Important Error handling is important because it allows you to gracefully handle unexpected errors in your code. By providing custom error handling, you can provide a better user experience by providing more informative error messages and Continue Reading

exception handling

How to Handle Errors in Scala

Reading Time: 3 minutes Error handling is the process of handling the possibility of failure. For example, failing to read a file and then continuing to use that bad input would clearly be problematic. Noticing and explicitly managing these errors saves the rest of the program from various pitfalls. When an exception occurs, say an Arithmetic Exception then the current operation is aborted. Then the runtime system looks for an exception Continue Reading

zio

How to handle Exceptions in Zio | Practical Implementation

Reading Time: 3 minutes In the previous blog ZIO Effects: How to Handle Errors? we have learned about How ZIO provides various means to handle and respond to failures. In addition to this blog, we will see all the ways to handle the exceptions with its Implementation. Either If the effect fails, the result is in the form of Left If the effect succeeds, the result is in the form Continue Reading

How to use Exception Handling Mechanism

Reading Time: 4 minutes Introduction: One of the fundamental and important aspects of programming is Exception Handling. A program needs an environment to handle the potential errors and abnormal conditions. Programming does not end with writing code that executes and creates a result, as we also have to handle errors in a user-friendly manner. There are several types of errors that could occur when we run a program. Some Continue Reading

Introductory Scala Concepts (Pattern Matching, Option, and Try/Success/Failure)

Reading Time: 4 minutes Pattern Matching: Scala Pattern matching is one of the features of functional programming that make it such an awesome paradigm. This tool is somewhat similar to switch statements you might be familiar with from other languages such as Java or Python, however Scala pattern matching is a much more powerful tool. In short, pattern matching allows one to check a value against a pattern as Continue Reading

Exception Handling in Scala

Exception handling in Scala

Reading Time: 6 minutes Exception handling is very important whenever we are developing any application. In this blog I will cover the magic of exception handling in Scala.

Understanding Java enums

Understanding Java enums

Reading Time: 8 minutes Hello all, in this blog post we will study one of the strongest features of the Java language, enum’s. A good understanding of Java enum can make your program stand out of the crowd, and we will see how. We’ll establish a good understanding of the feature, learn how Java enum are different from other languages. Also, we will see the scenarios where we can Continue Reading

Different ways of Handling Exceptions in CompletableFutures

Reading Time: 3 minutes Hi Folks! As part of this blog, we will explore how we can handle exception in the different computing stages when we use CompletableFuture. We assume the read has the basic idea of the CompletableFuture. Nonethless, will start with the basic introduction of the CompletableFuture. What is CompletableFuture A CompletableFuture is used for asynchronous programming which was introduced as an improvement of the java Future API in Continue Reading

struct

Different ways for `Error Propagation` in Rust

Reading Time: 2 minutes Error Propagation means the code, that detects the problem, must propagate error information back to the caller function so that it can handle the problem. In the real world, the practice of Error Propagation is necessary. One of the benefits is that your code will look cleaner by simply propagating error information back to the caller that can handle the error and another benefit is Continue Reading

You can live without Exceptions, If you are using RUST

Reading Time: 3 minutes If you are coming from Java background, where you have used Exception Handling extensively and you have started working on new language like RUST, which doesn’t support Exception Handling then you will be forced to think that does such kind of world really exists? The Java story Java provides full coverage to Exceptions and those are required to be handled with try-catch like construct. In Java, Continue Reading

monads

Back2Basics: Exception Handling – #3

Reading Time: 2 minutes In our previous blog Exception Handling – #2, we talked about how we can handle exception using Either. In this blog, we will explore further about Either, how we can elegantly handle exceptions using Either while working with Collections. We use collections when we want to perform some operations on elements. But what if something goes wrong while performing the transformation, do you have any Continue Reading

monads

Back2Basics: Exception Handling – #2

Reading Time: 3 minutes In our previous blog, we have seen how we can handle exceptions using try/catch and Try block.  In this blog, we will explore how we can handle exceptions using Either. Either, just like a Try, is also a container type which can have one value either Left or Right at a time. We can also use Option to handle exceptions but if an exception occurs returning Continue Reading

monads

Back2Basics: Exception Handling – #1

Reading Time: 3 minutes While building an application, it is common that something might go wrong. What if there is an attempt to divide a number by 0 or fetching the data from the database which does not exist, or reading a file which can’t be located? We need to handle such situations to make sure our application does not go down. Every language provides ways to handle such Continue Reading