private int handleException(Exception e) {
        int errno;

        e.printStackTrace();
        if (e instanceof FuseException) {
            errno = handleErrno(((FuseException) e).getErrno());
            if (log != null && log.isDebugEnabled()) {
                log.debug(e);
            }
        } else if (e instanceof BufferOverflowException) {
            errno = handleErrno(Errno.ERANGE);
            if (log != null && log.isDebugEnabled()) {
                log.debug(e);
            }
        } else {
            errno = handleErrno(Errno.EFAULT);
            if (log != null) {
                log.error(e);
            }
        }

        return errno;
    }