alphagov/specialist-publisher — pull request #256 by Themitchell (2014-09-17 09:42:39+00:00)
Title: Robustify manual publishing

Instead of rescueing from specific HTTP errors raised by the panopticon registerer (or any other API wrapper used by the publishing chain) we now rescue from GdsApi::HTTPErrorResponse types. This is something we would like to change. wrapper classes around the gds-api-adapters should handle errors and error logging themselves in the future. There is thought towards allowing the API wrappers to an object which stores the state of the publishing (PublishingTask maybe?) which could be handed to the worker in order to query the state of a particular publishing job. This would allow us to correctly raise an error in the worker without frivolously catching GdsApi exceptions and making the worker unaware off GdsApi. This change would require a large refactor and is something we would like to discuss with the group as whole in further tech discussions, however for now, this allows us to handle all API exceptions to be caught by the worker in a more self explanatory fashion.