A
A
artshelom2017-05-26 16:17:10
Java
artshelom, 2017-05-26 16:17:10

Where should I put an exception?

And to be more precise, where to put throw and catch. How to understand where to put one, where the other and whether it is needed here.
For example, let's take a program for parsing a site and writing to a database.
We put an exception when reading the site and another one when parsing and that's it.
Where else do you need it ??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Axian Ltd., 2017-05-26
@artshelom

This is a matter of application architecture design and therefore a religious question. Ask yourself the question - to whom and how will you give error messages and how to process them (continue, restart, destroy something, etc., what does this error affect)? Depending on this, you will choose a place for throw and catch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question