Questions tagged [custom-exceptions]

Custom Exception inherits the properties from the Exception class. Whenever we declare our own exception, it is known as custom exception.

Custom Exception inherits the properties from the Exception class. Whenever we declare our own exception, it is known as custom exception.

242 questions
0
votes
1 answer

Not able to catch custom exception of web service in their own catch blocks

We are using a web service which throws 3 types of custom web service faults i.e. ServiceException, ConnectionException and InvalidDataException. Along with these catch blocks, we have also put in the catch block for RemoteAccessException which is…
0
votes
1 answer

Custom exception handling and usage for laboratory web site

I know similar things have been asked before but it doesn't remove my doubts on the matter. Around all my pages Page_Load methodes and every other methode that calls a methode that connects to the database, I put my code inside a try catch…
reaper_unique
  • 2,916
  • 3
  • 28
  • 48
-1
votes
2 answers

Why i'm getting this output in exception handling in Java

Can anybody explain to me what is happening here? Output I'm getting is generic exception caught public class TestingString { static void testCode() throws MyOwnException { try { throw new MyOwnException("test…
-1
votes
2 answers

In C# I have implemented a custom exception, how do I now implement it?

I'm making a Tic-Tac-Toe game for an assignment and I am new to C#. I have a custom exception for bad moves called BadMoveException, which would be if the user enters anything other than 0-8. There is existing code for the assignment and I'm…
PyroGirl8
  • 29
  • 4
-1
votes
1 answer

Application.ThreadException is getting incorrect Win32Exception type

We have a very large complicated application that has a ThreadException handler intialized at startup, and any exceptions thrown by the application that are not handled immediately are handled by this ThreadException handler in a unified way. This…
-1
votes
1 answer

problems with exception in java app

Who could help me with exceptions, I have a task to make a small simulation of student app for university. So I have a log in page and in that page I have labels and text fields for name, surname, adress, city and student index book. I have to make…
Mapet
  • 109
  • 1
  • 8
-1
votes
1 answer

Custom Checked Exception Java

I'm trying to understand exceptions and I'm getting errors when I try to implement a custom one I made. I was given directions to make a no constructor that passes the string below to the super constructor. I keep getting compiler errors and I'm not…
Joseph hooper
  • 967
  • 4
  • 16
  • 35
-1
votes
2 answers

Catching a custom exception

I am having an issue with my code. I have simplified it here: public class SuperDuper { public static void main(String[] args) { try{ method(); } catch(CustomException e) { …
anak
  • 129
  • 8
-1
votes
3 answers

How to create custom exception handler for custom controls or extension methods

I am creating an extension method in C# to retrieve some value from datagridview. Here if a user gives column name that doesnot exists then i want this function to throw an exception that can be handled at the place where this function will be…
Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
-1
votes
3 answers

if statement inside a try catch statement not detecting try/catch part

So i've got an assignment for class and i'm completly stuck. I've lurked around here all semester and have found what i've needed but this time i'm lost. I need help with a try catch statement inside of a loop. The assignment wants us to have…
michael.m
  • 1
  • 1
  • 3
-1
votes
2 answers

Inserting while raising custom exceptions

if not(my_value < max_limit): print "value of is %g and hence invalid. It can be upto $g" % (my_value, max_limit) raise LimitFailureCheck("Failed due to Incorrect value") I have defined my custom exception as LimitFailureCheck in other…
tryPy
  • 71
  • 1
  • 11
-1
votes
1 answer

How to raise an exception for checking a method present in different module

I have 4 modules. 1. run.py Here I'm doing initialization and setup of class A and Class B. And what I want to do is: try: x = x[0]() except TestFailure as tf: print tf.message where due to for loop, x iterates over class A…
-1
votes
3 answers

Custom exception in java for string

How do I make a custom exception to determine that a string != 1? So far this is what I have, but I'm not sure if it's anywhere close to being right. I'm trying to program a card game, and I want to throw an exception for if (rank.length() != 1) { …
-2
votes
1 answer

Throwing custom exceptions when using an attribute to find an object in java

I am writing a program in which I have to create a method that finds a CustomerAccount object by the registration number associated with it. I also need to use a custom exception for when the registration number can't be found in the ArrayList of…
Amanda
  • 1
-2
votes
3 answers

Exceptions (Java)

Ok I have been trying this exercise because I am not good at exceptions.So here is the context of the exercise:Write a class with main method(the following code is give by the task): public class task{ public static void main( String[]…
1 2 3
16
17