Modify error handling with exception handling
Opened this issue · 3 comments
diptangsu commented
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.
lelloman commented
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 commented
Great thanks, then I'm gonna do it :)