Throw an exception if we can't initialize the context