public static <R> R tryToExecute(
        final UnsafeSupplier<R> supplier,
        final Eid eid
    ) {
        try {
            return supplier.get();
        } catch (Exception throwable) {
            throw new EidRuntimeException(ensureEid(eid), throwable);
        }
    }
public static < R > R tryToExecute ( final UnsafeSupplier < R > supplier , final Eid eid ) { try { return supplier . get ( ) ; } catch ( Exception throwable ) { throw new EidRuntimeException ( ensureEid ( eid ) , throwable ) ; } }
Tries to execute code in given unsafe supplier code block, and if
exception is thrown, it will gets rethrown as a {@link EidRuntimeException}
with eid given as a argument. This is because this exception is
treated as a software bug!
<p>
Example:
<pre>
Document doc = EidExecutions.tryToExecute(new UnsafeSupplier&lt;Document&gt;}() {
&#64;Override
public Document get() throws SAXException, IOException {
DocumentBuilder docBuilder = ...
return docBuilder.parse(new InputSource(reader));
}
}, new Eid("20150718:121521"));
</pre>

@param <R>      return type
@param supplier unsafe supplier code to be executed within a try-catch
block
@param eid      unique developer identifier from date for ex.:
"20150716:123200"
@return A block of code return type, if exception is not thrown
@throws EidRuntimeException if code block thrown any exception, which
in that case is wrapped in EidRuntimeException