Azure / api-management-developer-portal

Developer portal provided by the Azure API Management service.
MIT License
488 stars 318 forks source link

Npm run publish step eats exception #1225

Open anshul-kumar-agl opened 3 years ago

anshul-kumar-agl commented 3 years ago

In Npm run publish command, if there is any error while publishing, code only logs it and eats exception by returning null. The code is part of node_module @paperbits/core, so we have no control over the code.

For example, mediaPublisher.ts and pagePublisher.ts are the publishing modules where exceptions are getting eaten up.

image

So if somehow during publishing, some error happens, Npm command doesn't treat it as error.

Can it be suggested how we can achieve treatment of errors happening during publishing be reported as error so that necessary action can be taken.

Our use case is as follows:

azaslonov commented 3 years ago

Hi @anshul-kumar-agl, right this is intentional. Failing publishing (at least in managed version) because of the unavailable resource and not telling it the reason to customers would be not user-friendly. To address this we're rolling out the new publishing API which will have error details in the portal revision records.

For the self-hosted version, you can override MediaPublisher to throw the error terminating the publishing. Having said that, I think a special setting would be good to configure this behavior.