# useThrowableHook<T> static method

T useThrowableHook<T>(

1. ApplicationHook hook,
2. ThrowingSupplier<T> action

)

Executes a throwable action with a specific application hook.

Similar to useHook but supports actions that can throw exceptions and return values.

`hook` the application hook to use `action` the throwable action to execute

Returns the result of the action

## Implementation

    static T useThrowableHook<T>(ApplicationHook hook, ThrowingSupplier<T> action) {
    		_applicationHook.set(hook);
    		try {
    			return action.get();
    		} finally {
    			_applicationHook.remove();
    		}
    	}