{"record":{"id":"829a5b49f87625c5","repo":"affaan-m/ECC","slug":"invalid-did-did-r-must-start-with-did","errorCode":null,"errorMessage":"invalid DID: {did!r} (must start with 'did:')","messagePattern":"invalid DID: (.+?) \\(must start with 'did:'\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"integrations/aura/adapter.py","lineNumber":159,"sourceCode":"def aura_verdict(\n    did: str,\n    *,\n    base_url: str = DEFAULT_BASE_URL,\n    timeout: float = DEFAULT_TIMEOUT,\n    _fetch: Callable[[str, float], dict[str, Any]] = _http_get_json,\n) -> AuraVerdict:\n    \"\"\"\n    Look up the trust verdict for a counterparty DID. Never raises on a\n    network/parse failure — returns an `unknown` verdict instead, leaving the\n    proceed/abort decision to the caller's policy (see before_settle).\n\n        v = aura_verdict(\"did:aura:z6Mk...\")\n        print(v.verdict, v.reason, v.score)\n\n    `_fetch` is an injection seam for tests; production callers ignore it.\n    \"\"\"\n    if not did or not str(did).startswith(\"did:\"):\n        raise ValueError(f\"invalid DID: {did!r} (must start with 'did:')\")\n\n    url = f\"{base_url.rstrip('/')}/check?\" + urllib.parse.urlencode({\"did\": did})\n    try:\n        body = _fetch(url, timeout)\n    except urllib.error.HTTPError as e:\n        return AuraVerdict.invalid_response(did, f\"AURA returned HTTP {e.code}: {e.reason}\")\n    except (urllib.error.URLError, TimeoutError, OSError) as e:\n        return AuraVerdict.unreachable(did, f\"AURA unreachable: {e}\")\n    except (json.JSONDecodeError, ValueError) as e:\n        return AuraVerdict.invalid_response(did, f\"AURA returned non-JSON: {e}\")\n\n    if not isinstance(body, dict):\n        return AuraVerdict.invalid_response(did, \"AURA returned an unexpected shape\")\n    return AuraVerdict.from_payload(did, body)\n\n\ndef before_settle(\n    did: str,","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/integrations/aura/adapter.py#L141-L177","documentation":"Error \"invalid DID: {did!r} (must start with 'did:')\" thrown in affaan-m/ECC.","triggerScenarios":"Thrown at integrations/aura/adapter.py:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a DID string that starts with 'did:' (e.g. 'did:aura:z6Mk...'); empty or non-DID identifiers are rejected before any network call.","Trim whitespace and verify the identifier came from the expected DID field, not a raw address or name."],"exampleFix":"v = aura_verdict(f\"did:aura:{raw_id}\") if not raw_id.startswith('did:') else aura_verdict(raw_id)","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}