custom-exceptions Questions
3
Solved
How to display the appropriate error message when some exception occurs.
Suppose during GET methods if the data is not found, it should display the custom exception message.
Similarly if we are t...
Helmet asked 21/9, 2018 at 5:17
5
Solved
Branching off of questions like this one, I'm looking to wrap jQuery's $.ajax() method such that I can provide error handling in one location, which would then be used automatically by all of an ap...
Croupier asked 3/12, 2010 at 2:27
3
I am creating a C# application and am trying to take advantage of custom exceptions when appropriate. I've looked at other questions here and at the MSDN design guidelines but didn't come across an...
Claver asked 8/10, 2012 at 21:52
3
Solved
I'm looking at Python's built-in exceptions and wondering what the closest equivalent of Java's UnsupportedOperationException is. NotImplementedError is close but seems to suggest something slightl...
Arabic asked 28/6, 2016 at 3:37
8
Solved
I'm a student in my first C++ programming class, and I'm working on a project where we have to create multiple custom exception classes, and then in one of our event handlers, use a try/catch block...
Masuria asked 25/3, 2010 at 3:37
2
I have a custom exception (which is further extended in may other custom exceptions). My project requires log all the customExceptions (and all of its decendents) that occurs. I have a logger that ...
Intrust asked 28/2, 2018 at 20:52
1
Solved
I'm testing how throwing when doing stack unwinding calls std::terminate by having the copy constructor of the class that is used to throw, throwing.
Per C++14 N4296 - §15.1.3:
Throwing an exc...
Bavaria asked 15/6, 2018 at 23:2
2
Solved
class AppError(Exception):
pass
class MissingInputError(AppError):
pass
class ValidationError(AppError):
pass
...
def validate(self):
""" Validate Input and save it "&quo...
Renfrew asked 30/5, 2011 at 19:41
4
Solved
I want to throw an array as an exception in php, instead of a string. Is it possible to do this if you define your own class that extends the Exception class?
For example throw new CustomException...
Greenockite asked 22/7, 2011 at 23:26
1
Solved
I don't know what wrong with this, but instanceof doesn't seem to work.
AppError.ts
class AppError extends Error {
public statusCode;
constructor(message, statusCode) {
super(message);
this.n...
Roentgenology asked 22/11, 2017 at 7:37
1
I have a resource:
@GET
@Path("/print-order")
@Produces("application/pdf")
public byte[] printOrder(@QueryParam("id") Long orderId) {
return ...;
}
...which can throw an error that is relevant ...
Anyhow asked 2/9, 2017 at 10:56
4
Solved
So I have an upcoming assignment dealing with exceptions and using them in my current address book program that most of the homework is centered around. I decided to play around with exceptions and...
Jackstraws asked 24/4, 2013 at 3:18
3
Solved
Often I need to throw a custom(ized) error. Like when a resource cannot be found due to a mismatch in parameters or so.
I prefer to throw existing errors or, throw an error that is inherited from...
Peavy asked 29/6, 2011 at 13:38
4
Solved
I can't seem to find much information about custom exception classes.
What I do know
You can declare your custom error class and let it inherit from StandardError, so it can be rescued:
class My...
Dior asked 19/4, 2013 at 14:11
2
It appears that one cannot resume the execution of test once you hit the raise the user defined exception in Python. But in my scenario I want to check error occurred for different input values. Bu...
Excoriate asked 29/1, 2016 at 16:35
3
Solved
I'm not sure that my custom exception approach is correct. What I want to do is to throw exceptions with custom messages but it seems that I created a memory leak...
class LoadException: public st...
Playful asked 3/7, 2013 at 2:45
5
Solved
Is it possible to create user-defined exceptions and be able to change the SQLERRM?
For example:
DECLARE
ex_custom EXCEPTION;
BEGIN
RAISE ex_custom;
EXCEPTION
WHEN ex_custom THEN
DBMS_OUTPUT....
Scourings asked 16/5, 2011 at 16:32
2
In my Rails 3.2 app, I'm trying to use config.exceptions_app to route exceptions through the routing table to render error-specific pages (especially one for 401 Forbidden). Here's what I've got so...
Marcasite asked 27/8, 2013 at 4:48
1
Solved
If I have following
function ValidationException(nr, msg){
this.message = msg;
this.name = "my exception";
this.number = nr;
}
function myFunction(dayOfWeek){
if(dayOfWeek > 7){
throw new...
Thready asked 2/4, 2015 at 20:53
2
I am trying to handle custom exception handling using Spring MVC. DAO layer exception handler by service layer and service layer wrap that exception and handle that exception by Controller exceptio...
Polytypic asked 3/2, 2015 at 9:41
2
Solved
Douglas Crockford recommends doing something like this:
throw {
name: "System Error",
message: "Something horrible happened."
};
But you could also do something like this:
function IllegalArg...
Magnification asked 25/10, 2012 at 21:36
3
Solved
The following code throws RuntimeError: maximum recursion depth exceeded while getting the str of an object. I can resolve the infinite recursion in two different ways, but I don't understand why e...
Abixah asked 27/1, 2014 at 21:32
8
I have a custom exception filter that I'm calling by virtue of adding a [CustomExceptionFilter] attribute to my class. It works as I'd like it to, however if the action method is returning a partia...
Amphibious asked 12/2, 2010 at 16:44
2
Solved
I wonder why the IllegalArgumentException class does not need to be catched or declared, while other exceptions have to (eg java.net.MalformedURLException).
public void foo() {
throw new IllegalA...
Badminton asked 4/10, 2013 at 20:33
1
Solved
I'm trying to serialize a custom Exception in Java using writeValueAsString() method from Jackson library. I intend to send it by HTTP to another machine. This is working partialy because not all f...
Beers asked 27/9, 2013 at 15:5
1 Next >
© 2022 - 2024 — McMap. All rights reserved.