protected function throwInitError($code, $function)
    {
        switch ($code) {
            case -4:
                throw new \RuntimeException(sprintf(
                    'There was a memory allocation problem while calling %s::%s',
                    __CLASS__,
                    $function
                ));
                break;
            case -3:
                throw new \RuntimeException(sprintf(
                    'An incorrect encryption key length was used while calling %s::%s',
                    __CLASS__,
                    $function
                ));
                break;
            default:
                if (is_integer($code) && $code < 0) {
                    throw new \RuntimeException(sprintf(
                        'An unknown error was caught while calling %s::%s',
                        __CLASS__,
                        $function
                    ));
                }
                break;
        }
    }