error handling logic in php
I don't really like the method of exception pseudo-typing you're doing, I'd use different objects to represent the type of exception rather than the content, like so:

function macaddresses($ip, $name)
{
    try
    {
        //some code....
        if($obj-&gt;connect())
        {
            //do something else
            return $macaddies;
        }
        else
        {
            throw new UserVisibleException("Unable to connect to device. Please contact administrator!");
        }                                
    }
    catch(Exception $e)
    {
        $this-&gt;processException($e);
    }
}

private function processException($exception)
{
    if($exception instanceof UserVisibleException)
    {
        throw $exception;
    }
    else
    {
        log_message('error', $exception-&gt;getTraceAsString());
        throw new UserVisibleException(null, $exception);
    }
}

class UserVisibleException extends Exception
{
    public function __construct($message = null, $cause = null, $code = 1)
    {
        parent::__construct
        (
            $message === null ? "Oops!  Something big just happened." : $message,
            $code, $cause
        );
    }
}


I put processException() as a method as it isn't clear whether you're using this design pattern elsewhere, but I assume so as you're connecting to something and there's usually other exceptions that can happen later. If you aren't, you can just stick it back into the catch block of macaddresses().

Additionally, if it isn't clear, the ternary is so you don't have to manually type in the message to attach a cause to an unknown exception being wrapped. And I took the liberty of replacing the generic message "connection" with the stack trace of the exception that caused it being passed to your logger, as this more detailed information will be useful should you wish to debug the cause of it.