Exception Handling

Different ways for `Error Propagation` in Rust

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

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

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

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

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

Java: Try With Resources

Try with resources is a special type of try statement where we can declare more than one resources within a single try statement. This feature came in Java 7. But it has some limitation with itself that overcomes in Java 9. We will discuss this limitation through the examples. Now, Firstly we have to know what is resource actually, A resource is an object that must be closed after Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!