Allow Quant API exceptions to be bubbled up

Created on 20 February 2023, over 1 year ago
Updated 4 January 2024, 6 months ago

Problem/Motivation

In some situations, rather than quant_api logging an exception, we might want to have the exception bubble up so the calling code can handle it. Example: When content is unpublished, the canonical redirect is unpublished. If the content is then deleted, there is another unpublish call for the canonical redirect which is redundant. Rather than have to check if it's already unpublished (which requires more API calls), we could simply catch and ignore these unpublish exceptions in the calling code.

Steps to reproduce

  1. Create node with alias
  2. Canoncial redirect should be created
  3. Unpublish node
  4. Canonical redirect should be unpublished
  5. Delete node
  6. Error in logs: Client error: `PATCH https://api.quantcdn.io/v1/unpublish` resulted in a `400 Bad Request` response: @"errorMsg":"Resource is already unpublished.","error":true

Proposed resolution

Add code to allow a bubbleUp parameter for API functions and throw the exception (rather than log it) if bubbleUp is TRUE. May need a new Exception class added.

Remaining tasks

  1. Vet idea with team
  2. Update code
  3. Review and test
  4. Commit :)

User interface changes

API changes

Allow bubbling up exceptions to calling code.

Data model changes

✨ Feature request
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024