use middlewarify 0.0.4 for error throwing