Improve error handling: propagate errors instead of silently swallowing them - #1
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…ng them - _effective_status: log malformed pickup_to instead of silently ignoring - _box_from_row/_order_from_row: raise LookupError on missing partner instead of using fallback values - create_box: validate partner_id exists before inserting (LookupError → 404) - partner_boxes/partner_orders: return 404 for non-existent partner_id - redeem: return 404/409 HTTP errors instead of always 200 - admin_refund: return 404 for missing order, 409 for invalid status (with reason) - Store.refund: return (success, reason) tuple for richer error info Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
wpalish
pushed a commit
that referenced
this pull request
Jul 16, 2026
…арточка); +контраст футера По UX-ревью: - #1 localStorage-нотис был плавающей центр-карточкой (читалось как «глюк» поверх секций) → тонкая полоса во всю ширину, приклеена к низу (над bottom-nav на мобиле, к краю на десктопе). Показ один раз (флаг ym_cookies уже был). - #6 контраст копирайта/FAQ-текста в футере поднят (.6→.78, .7→.82 opacity) — запас под WCAG AA. Уже было в коде: #4 срочность («🔥 осталось N» + окно выдачи), #7 соцсети на светлом --on-ink (не бледные). Требуют ассетов (отдельно): #2 превью карты, #3 логотипы партнёров/отзывы, #5 лого-марка, #8 PWA-бейджи. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Several places swallowed errors or returned misleading success responses. This PR surfaces those errors through proper HTTP status codes and explicit failures.
Data integrity —
_box_from_row/_order_from_row: Previously used silent fallbacks ("—","",0.0) when a referenced partner was missing. Now raisesLookupErrorso data corruption is caught immediately rather than producing ghost records.Store.create_box: Now validatespartner_idexists before inserting the box row. The API layer catchesLookupError→ HTTP 404.Store._effective_status: Wasexcept ValueError: passon malformedpickup_to— silently treating unparseable deadlines as non-expired. Now logs a warning vialogger.warning(...)and returns the stored status explicitly.POST /redeem: Was always HTTP 200 with{"ok": false, ...}for every failure (unknown code, already issued, expired). Now returns 404 (code not found) or 409 (conflict — already issued/expired/refunded).POST /admin/refund/{order_id}: Was{"refunded": false}with HTTP 200 for both missing orders and invalid-state orders. Now returns 404 or 409 with a reason string.Store.refundreturn type changed frombool→tuple[bool, str]to distinguish"not_found"from"invalid_status:{status}".GET /partners/{id}/boxesand/partners/{id}/orders: Silently returned[]for non-existent partners. Now validates via newStore.partner()method → HTTP 404.Link to Devin session: https://app.devin.ai/sessions/75d3e7a37fc3462f9ce7b3ed238d8575
Requested by: @wpalish