Changed exception handler for context setter to be looser