        } catch (GateMethodInternalException e) {
$DECLARED_EXCEPTIONS
            // if runtime exception occured in remote method, just re-throw it
            if (e.getCause() instanceof RuntimeException)
                throw new Exception((RuntimeException) e.getCause());

            throw new GateMethodInvocationException("Error or unknown checked exception was thrown by a method.", e);
        } catch (Exception e) {
            // this indicates a normal exception from remote service.
            throw new GateReceivedException(e);
        }
