Skip to content

[Fix]: FunctionClauseError: no function clause matching in DotcomWeb.ScheduleController.FinderApi.load_from_repos/2 - #3416

Merged
lvachon1 merged 3 commits into
mainfrom
lev/fix/invalid_arguments_journeys
Aug 13, 2026
Merged

[Fix]: FunctionClauseError: no function clause matching in DotcomWeb.ScheduleController.FinderApi.load_from_repos/2#3416
lvachon1 merged 3 commits into
mainfrom
lev/fix/invalid_arguments_journeys

Conversation

@lvachon1

Copy link
Copy Markdown
Contributor

Scope

Asana Ticket: QF | FunctionClauseError: no function clause matching in DotcomWeb.ScheduleController.FinderApi.load_from_repos/2

Implementation

Digging around the Sentry logs it appears that when/if invalid or incomplete URL params are supplied to schedules/finder_api/journeys the app crashes.

Added checks to ensure code only runs when supplied with proper parameters. Added an error message to handle invalid params instead of crashing.

Screenshots

N/A

How to test

Invalid arguments:

http://localhost:4001/schedules/finder_api/journeys?date=2026-08-13&stop=place-sstat&is_current=true&id=1

Valid arguments (empty result)

http://localhost:4001/schedules/finder_api/journeys?date=2026-08-13&stop=place-sstat&is_current=true&id=1&direction=1

…eters. Added an error message to handle invalid params instead of crashing.
@lvachon1
lvachon1 requested a review from a team as a code owner August 13, 2026 14:29
@lvachon1
lvachon1 requested a review from jlucytan August 13, 2026 14:29
Comment thread lib/dotcom_web/controllers/schedule/finder_api.ex Outdated
Comment thread lib/dotcom_web/controllers/schedule/finder_api.ex
@lvachon1
lvachon1 requested a review from jlucytan August 13, 2026 17:03
@lvachon1
lvachon1 merged commit 4648a64 into main Aug 13, 2026
26 checks passed
@lvachon1
lvachon1 deleted the lev/fix/invalid_arguments_journeys branch August 13, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants