For better or worse, marshal_exception is used from utils/, and it's not good to have utils/ depend on types.hh. Extract marshal_exception to make it possible to remove the dependency.