Added Error Checking

Context::setActive() now handles errors and reports them to the user.