Create a nested context/error class in tools.