sandalone
sandalone

Reputation: 41769

How to easily add Exception subclasses into catch?

Let's say I need to add some Exception subclasses into catch, such as these ones

    ...//
    catch (ConnectTimeoutException e) {
        e.printStackTrace();
    } catch (HttpHostConnectException e) {
        e.printStackTrace();
    }catch (IOException e) {
        e.printStackTrace();
    }  

The first two are (obviously) subclasses of IOException.

How can I add such subclasses into catch in a better (quicker, easier) way than copy/pasting then?

I am confident that IDEA has such automatic feature, but I am not sure which one it is or how to use it.

Upvotes: 3

Views: 131

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402413

Alt+Enter on try, Detail exceptions:

enter image description here

Upvotes: 1

Related Questions