roundcubemail/plugins/enigma/lib/enigma_driver_gnupg.php
protected function get_error_from_exception($e)
    {
        $data = array();

        if ($e instanceof Crypt_GPG_KeyNotFoundException) {
            $error = enigma_error::KEYNOTFOUND;
            $data['id'] = $e->getKeyId();
        }
        else if ($e instanceof Crypt_GPG_BadPassphraseException) {
            $error = enigma_error::BADPASS;
            $data['bad']     = $e->getBadPassphrases();
            $data['missing'] = $e->getMissingPassphrases();
        }
        else if ($e instanceof Crypt_GPG_NoDataException) {
            $error = enigma_error::NODATA;
        }
        else if ($e instanceof Crypt_GPG_DeletePrivateKeyException) {
            $error = enigma_error::DELKEY;
        }
        else {
            $error = enigma_error::INTERNAL;
        }

        $msg = $e->getMessage();

        return new enigma_error($error, $msg, $data);
    }
protected function get_error_from_exception($e)
    {
        $data = array();

        if ($e instanceof Crypt_GPG_KeyNotFoundException) {
            $error = enigma_error::KEYNOTFOUND;
            $data['id'] = $e->getKeyId();
        }
        else if ($e instanceof Crypt_GPG_BadPassphraseException) {
            $error = enigma_error::BADPASS;
            $data['bad']     = $e->getBadPassphrases();
            $data['missing'] = $e->getMissingPassphrases();
        }
        else if ($e instanceof Crypt_GPG_NoDataException) {
            $error = enigma_error::NODATA;
        }
        else if ($e instanceof Crypt_GPG_DeletePrivateKeyException) {
            $error = enigma_error::DELKEY;
        }
        else {
            $error = enigma_error::INTERNAL;
        }

        $msg = $e->getMessage();

        return new enigma_error($error, $msg, $data);
    }
protected function get_error_from_exception ( $ e ) { $ data = array ( ) ; if ( $ e instanceof Crypt_GPG_KeyNotFoundException ) { $ error = enigma_error :: KEYNOTFOUND ; $ data [ 'id' ] = $ e -> getKeyId ( ) ; } else if ( $ e instanceof Crypt_GPG_BadPassphraseException ) { $ error = enigma_error :: BADPASS ; $ data [ 'bad' ] = $ e -> getBadPassphrases ( ) ; $ data [ 'missing' ] = $ e -> getMissingPassphrases ( ) ; } else if ( $ e instanceof Crypt_GPG_NoDataException ) { $ error = enigma_error :: NODATA ; } else if ( $ e instanceof Crypt_GPG_DeletePrivateKeyException ) { $ error = enigma_error :: DELKEY ; } else { $ error = enigma_error :: INTERNAL ; } $ msg = $ e -> getMessage ( ) ; return new enigma_error ( $ error , $ msg , $ data ) ; }
Converts Crypt_GPG exception into Enigma's error object

@param mixed Exception object

@return enigma_error Error object
Converts Crypt_GPG exception into Enigma s error object