generate an error and marshal its stack