Page MenuHomePhabricator

[Generalised error] Data-policy-violation
Open, Needs TriagePublic

Description

This is a general error that came out of the discussions surrounding reformatting/rewriting all the collision/conflict errors

Acceptance criteria:

  • Current messages it will apply to: patch-result-label-description-duplicate, duplicate-label, label-description-duplicate, label-description-same-value, sitelink-conflict
  • HTTP status code: 422 (might be 409 for all or some of the current errors)
  • Error code: data-policy-violation
  • Error message: Edit violates data policy
  • Context: { 'violated-policy': 'unique-property-label|unique-label-description|TODO-something-smart-for-label-desc-same|unique-sitelink-target', and more, see below }

Current fav: option 1 of the ones below

  1. nested policy context

{ 'violated-policy': 'unique-label-description',
'violation-context': { 'language-code': 'foo', 'conflicting-item': ...

  1. policy dependent context fields

{ 'violated-policy': 'unique-sitelink-target',
'site-id': 'foo'

  1. generic field

{ 'violated-policy': 'unique-label-description',
'target-of-violating-data': '/labels/en',
'conflicting-resource': 'Q123' (special case, for label-description-same the ID of self)