|
462 | 462 | </span> |
463 | 463 | </a> |
464 | 464 |
|
| 465 | +</li> |
| 466 | + |
| 467 | + <li class="md-nav__item"> |
| 468 | + <a href="#missingdecodererror" class="md-nav__link"> |
| 469 | + <span class="md-ellipsis"> |
| 470 | + |
| 471 | + MissingDecoderError |
| 472 | + |
| 473 | + </span> |
| 474 | + </a> |
| 475 | + |
465 | 476 | </li> |
466 | 477 |
|
467 | 478 | <li class="md-nav__item"> |
|
830 | 841 | </span> |
831 | 842 | </a> |
832 | 843 |
|
| 844 | +</li> |
| 845 | + |
| 846 | + <li class="md-nav__item"> |
| 847 | + <a href="#missingdecodererror" class="md-nav__link"> |
| 848 | + <span class="md-ellipsis"> |
| 849 | + |
| 850 | + MissingDecoderError |
| 851 | + |
| 852 | + </span> |
| 853 | + </a> |
| 854 | + |
833 | 855 | </li> |
834 | 856 |
|
835 | 857 | <li class="md-nav__item"> |
@@ -891,7 +913,8 @@ <h2 id="the-exception-tree">The exception tree<a class="headerlink" href="#the-e |
891 | 913 | <a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a>│ └── ServiceUnavailableError (503) |
892 | 914 | <a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a>├── RetryBudgetExhaustedError (a retry was needed but the budget refused) |
893 | 915 | <a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a>├── BulkheadFullError (acquire_timeout elapsed before a slot opened) |
894 | | -<a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a>└── DecodeError (response_model= decoder failed; HTTP call itself succeeded) |
| 916 | +<a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a>├── DecodeError (response_model= decoder failed; HTTP call itself succeeded) |
| 917 | +<a id="__codelineno-0-20" name="__codelineno-0-20" href="#__codelineno-0-20"></a>└── MissingDecoderError (no registered decoder claims response_model=; fires before the HTTP call) |
895 | 918 | </code></pre></div> |
896 | 919 | <h2 id="status-to-exception-mapping">Status-to-exception mapping<a class="headerlink" href="#status-to-exception-mapping" title="Permanent link">¶</a></h2> |
897 | 920 | <table> |
@@ -1037,6 +1060,18 @@ <h2 id="decodeerror"><code>DecodeError</code><a class="headerlink" href="#decode |
1037 | 1060 | <a id="__codelineno-4-12" name="__codelineno-4-12" href="#__codelineno-4-12"></a> <span class="p">)</span> |
1038 | 1061 | <a id="__codelineno-4-13" name="__codelineno-4-13" href="#__codelineno-4-13"></a> <span class="k">raise</span> |
1039 | 1062 | </code></pre></div> |
| 1063 | +<h2 id="missingdecodererror"><code>MissingDecoderError</code><a class="headerlink" href="#missingdecodererror" title="Permanent link">¶</a></h2> |
| 1064 | +<p>Raised by <code>send()</code> / <code>send_with_response()</code> / verb methods when <code>response_model=</code> is set but no registered decoder claims the model. Carries:</p> |
| 1065 | +<ul> |
| 1066 | +<li><code>model: type</code> — the <code>response_model=</code> value that wasn't claimed.</li> |
| 1067 | +<li><code>registered_names: tuple[str, ...]</code> — class names of the registered decoders that all rejected the model. Empty tuple means no decoders were registered.</li> |
| 1068 | +</ul> |
| 1069 | +<p>Corrective action depends on the message hint:</p> |
| 1070 | +<ul> |
| 1071 | +<li><code>no decoders registered. Install pip install httpware[pydantic] or pip install httpware[msgspec], or pass decoders=[...] explicitly.</code> — install an extra or pass an explicit decoder list.</li> |
| 1072 | +<li><code>registered decoders (PydanticDecoder + MsgspecDecoder) all rejected it.</code> — your <code>response_model</code> type is exotic enough that neither built-in claims it. Pass a custom <code>ResponseDecoder</code> via <code>decoders=[...]</code>.</li> |
| 1073 | +</ul> |
| 1074 | +<p>Unlike <code>DecodeError</code>, this error fires <em>before</em> the HTTP request — no traffic is sent.</p> |
1040 | 1075 | <h2 id="see-also">See also<a class="headerlink" href="#see-also" title="Permanent link">¶</a></h2> |
1041 | 1076 | <ul> |
1042 | 1077 | <li><strong><a href="../resilience/">Resilience reference</a></strong> — <code>AsyncRetry</code>, <code>RetryBudget</code>, <code>AsyncBulkhead</code> parameter tables.</li> |
|
0 commit comments