Closed mauriciovieira closed 6 years ago
@brylie I am looking into this now.
@mauriciovieira thanks. I can help repeat the basic pattern in the other API endpoints, once you have a working example for createApiBackend.
@brylie what I currently get using the same credentials of api-umbrella @ apinf.io and running meteor --settings settings.json test-packages ./ is
so I am now trying to set my local api-umbrella server to better debug the rails/node.js part.
Be sure to include a trailing slash in your base_url
configuration.
Also, the backend changes may need to be published. We can do this via the Admin API Config Publish endpoint. Alternatively, this can be done via the API Umbrella admin UI.
@brylie The trailling slash is there. At this point I think I don't need to publish the changes, I just want to get the errors.
For some reason, now I am getting the 422 error. This one is an umbrella's bug, but can be used to work with:
Try working in my development branch.
@brylie I made some improvements with error handling on mauriciovieira/meteor-api-umbrella:spike branch
It is still not fully functional, but I believe I am in the correct path.
@mauriciovieira I have merged your pull request.
closing since the work related to this task has been merged as a PR
Nowadays, apiUmbrellaWeb.adminApi.v1.apiBackends.createApiBackend(constructedBackend) does not treat errors. In case of failure https://github.com/brylie/meteor-api-umbrella/blob/master/server/admin-api/v1/apiBackends.js#L29 should treat the error and throw ApiUmbrellaError with the details.
For instance, Error.message now is a string like
'failed [422] {"errors":{"backend_protocol":["is not included in the list"]}}'
. It should be a ApiUmbrellaError withalong with the default message.
Related documentation: