Questions tagged [throwable]

The `Throwable` class is the superclass of all errors and exceptions in the Java programming language. Only objects that are instances of this class (or one of its subclasses) are thrown by the Java VM or could be thrown by the Java `throw` statement.

The Throwable class is the superclass of all errors and exceptions in the Java programming language. Only objects that are instances of this class (or one of its subclasses) are thrown by the Java VM or could be thrown by the Java throw statement. Similarly, only this class or one of its subclasses can be the argument type in a catch clause. For the purposes of compile-time checking of exceptions, Throwable and any subclass of Throwable that is not also a subclass of either RuntimeException or Error are regarded as checked exceptions.

For the further details and reference the documentation for Class Throwable.

165 questions
0
votes
0 answers

Java custom non-checked Throwable

I just wanna reimplement Ruby's catch-throw structure in Java. The catch-throw structure is like catch :halt do loop do # an infinite loop puts 'foo' throw :halt end end The message foo is printed only once. The essence is that what…
Aetherus
  • 8,720
  • 1
  • 22
  • 36
0
votes
1 answer

Java - Thread Stops Without Any Indication

I have a weird issue, where I'm trying to make a program which is using a thread to implement a tick update system, using the following code: @Override public void run(){ long lastTime = System.nanoTime(); long deltaTime; float…
SchoolJava101
  • 609
  • 1
  • 5
  • 8
0
votes
1 answer

How to capture the cause of an exception from a throwable?

I have the following code to track uncaught exceptions using google analytics: ExceptionReporter myHandler = new ExceptionReporter(AnalyticsTrackers.getInstance().get(AnalyticsTrackers.Target.APP), …
suku
  • 10,507
  • 16
  • 75
  • 120
0
votes
2 answers

run some logic after exception happen dynamically

I think that all Error and Exception type extend from Exception class so how could i watch exception when the application stopped working because i want to run some logic when the exception thrown i am not just asking about try{} catch {} finally…
Ahmed Nasser
  • 114
  • 6
0
votes
1 answer

converting the expression to lambda

Can any one help me with converting this piece of code into lambda expression, I am struck with this Observable.create(new OnSubscribe() { @Override public void call(Subscriber arg0) { User…
Sanket
  • 355
  • 5
  • 14
0
votes
1 answer

How can i catch exceptions in a method that throws them(JAVA)?

I have a class with a method that throws some exceptions and catches them inside itself, but when i call it in my Main class they seem to not being catched. An example about my problem: public class Test { public static void method (int number)…
0
votes
1 answer

How to handle future completion without explicit handling of non-Exception Throwables

The pattern I keep using for handling Future completions inside of Akka looks something like this: val caller = sender() doSomethingAsync().onComplete { case Success(arg) => caller ! SuccessMsg(arg) case Failure(e:Exception) => caller !…
Arne Claassen
  • 14,088
  • 5
  • 67
  • 106
0
votes
2 answers

Throwable constructors

The 4 types of Throwable constructors are :- Throwable() : Constructs a new throwable with null as its detail message. Throwable(String message) : Constructs a new throwable with the specified detail message. Throwable(String message, Throwable…
kevin gomes
  • 1,775
  • 5
  • 22
  • 30
0
votes
1 answer

"containment:parent" is not working correctly

I've created a demo page that generates a masonry-style layout from several divs, and then after x seconds runs the jquery.throwable script on said divs. Here it is: http://output.jsbin.com/yitaru/2/ The problem I've run into is that throwable's…
ennuipreneur
  • 13
  • 1
  • 5
0
votes
2 answers

what exceptions need to be thrown in java?

I have these two java codes: class test { public static void main(String[] args) throws IOException { System.out.println("Before try”"); try{} catch(Throwable d ) {} System.out.println("done"); } } it will…
user3159060
  • 131
  • 1
  • 1
  • 8
0
votes
0 answers

FileObserver throws Throwable in one of my devices

I've got 2 different devices in which I'm testing my App. One of them has Android 4.0.3 and the other one 4.3. Normally, I don't care which one I'm using but as I need to upload files to dropbox and download them in other device, I started to use…
Fernando
  • 751
  • 2
  • 13
  • 27
0
votes
5 answers

Java Exception handle case

public void backendExecute(Map appParams, BackendTaskMetaData metaData) throws Throwable { try { PeriodicTaskData ptd = (PeriodicTaskData) appParams.get(PeriodicTaskData.PARAM_KEY); String bizKey = ptd.getBusinessKey(); }…
FelixXu
  • 3
  • 2
0
votes
1 answer

Best way to handle a NullPointerException coming from a Throwable catch? (Android)

What is the best way to handle a NullPointerException coming from a Throwable catch. public void run() { try{ }catch (Throwable e){ // e.getMessage() is equal to null // and sends a NullPointerException if…
Pompeyo
  • 1,459
  • 3
  • 18
  • 42
0
votes
0 answers

Unhandled exception type using external library on Java Android

I'm doing a little class to save and load information from a game, by the moment I have coded this: import java.io.FileReader; import java.io.FileWriter; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.Marshaller; import…
user2204353
  • 195
  • 1
  • 2
  • 10
0
votes
4 answers

What is the built in base class to handle all exceptions in Java

What is the built in base class to handle all exceptions in Java? Is It Exception or Throwable? What is the difference between two builtin classes,can someone explain me.
Akbar
  • 1,509
  • 1
  • 16
  • 32
1 2 3
10
11