» Home » Throw » Page 1
Is it possible to throw a java exception through the calling method of a base class that does not throw exceptions?
by sub-80 in Java

This may be a ridiculous Java question about exception handling, but I have a UI actor (an Android Activity) that is requesting services from my subclass of ContentProvider. The subclass wants to throw some exceptions when sd-card is full, sd-card is missing, network i/o errros, etc. However, when I code the CP-subclass to throw my exceptions, the compiler offers to add the exceptions to the

Node.js (with socket.io and express) throw “events.js:71 throw arguments[1]; // Unhandled 'error' event”
by raven84 in Programming Languages

I running express (nginx proxy) with socket.io and after few moments (app for some time works fine) after server start console throw this:

throw arguments[1]; // Unhandled 'error' event
Error: socket hang up
at createHangUpError (http.js:1360:15)
at ServerResponse.OutgoingMessage._writeRaw (http.js:507

javascript what is the difference in throw new Error and throw(object)
by Timo in Web Design

I want to write a common error handler which will catch custom errors thrown on purpose at any instance of the code.

When I did throw new Error('sample') like in the following code

throw new Error({'hehe':'haha'})
//throw new Error('hehe');

Do you throw an exception when you know the method you're calling would just throw the same thing?
by Demo24 in Programming Languages

Say I have a method like this*:

public T GetItem(int index)
if (index < 0 || index >= _privateList.Count)
throw new ArgumentOutOfRangeException("index");
return _privateList[index];

Would you include that throw or leave it out? On the one hand I feel like it's good to handle

Is there an equivalent in T-SQL to C#'s “throw;” to re-throw exceptions?
by Gilmar Souza Jr. in C & C++ & C#

The title really is the question for this one: Is there an equivalent in T-SQL to C#'s "throw;" to re-throw exceptions?

In C# one can do this:

catch (Exception ex)
// Do something with the exception
throw; // Re-throw it as-is.

Is there somethin

difference between throw and throw new Exception()
by Mason McCuskey in Programming Languages

what is the difference between

try { ... }
catch{ throw }


try{ ... }
catch(Exception e) {throw new Exception(e.message) }

Regardless that the second shows a message ?

Can a custom stream throw its own custom exceptions or should it only throw IOException?
by dEXterz in Programming Languages

I have my own Connection class and a ConnectionStream class which essentially just wraps the Connection's send/receive methods.

The Connection send/receive methods can throw exceptions like ServerClosedConnException or NetworkShutdownException

Should my Stream be catching these and wrapping them in IOException (using innerException), or can it just let them bubble up to

How to throw an Exception when your method signature doesn't allow to throw Exception?
by Morbo in Programming Languages

I have a method like this:

public void getSomething(){

I want to throw an exception inside getSomething. The compiler will not allow me to do that because my method doesn't allow Exception to be thrown in there. But I need to throw a subclass of Exception for my testing (I can't throw Unchecked exception). This is clearly a hack but I need it

Catch vs Catch (Exception e) and Throw vs Throw e
by Red Storm in Programming Languages

Are these two code examples the same? Catch and Catch (Exception e) have the same output, and the result is also the same if I write Throw or Throw e.


catch (Exception e)
Console.WriteLine("{0} exception caught.", e);

Code 1:

static void A()
How to Use a Throw Net
by znotdead in Sports & Fitness
Throw nets are used to capture live bait for fishing. They are also referred to as cast nets. The net is circular, and weighted at the bottom with lead weights. When the net is thrown, it opens and sinks around the baitfish, trapping them in the net. The net operator then retrieves the net using the rope tied to the center. With the proper technique and some practice, you can use a throw net to co
TAGS : Throw

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .