Data-Structures icon indicating copy to clipboard operation
Data-Structures copied to clipboard

Modify error handling with exception handling

Open diptangsu opened this issue 6 years ago • 3 comments

For example, for the file Stack.java, pushing into a full-stack is prevented by an if-else block, change all such occurrences with user-defined exceptions.

diptangsu avatar Oct 02 '19 11:10 diptangsu

Hi, I'd like to pick this one up for hacktoberfest. I'm not entirely sure I understood what you mean by "user-defined exceptions". I was thinking to throw specific RuntimeException, to follow your example, defining a FullStackException extends RuntimeException and throw an instance of that. Would it be OK?

lelloman avatar Oct 02 '19 15:10 lelloman

@lelloman ofcourse.

diptangsu avatar Oct 02 '19 16:10 diptangsu

Great thanks, then I'm gonna do it :)

lelloman avatar Oct 02 '19 16:10 lelloman