Page MenuHomePhabricator

[services] [2/n] Replace panic with custom errors on search index lambda
ClosedPublic

Authored by will on Jan 18 2024, 3:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 10:03 PM
Unknown Object (File)
Fri, Nov 8, 7:16 PM
Unknown Object (File)
Fri, Nov 8, 7:16 PM
Unknown Object (File)
Fri, Nov 8, 7:16 PM
Unknown Object (File)
Fri, Nov 8, 1:17 PM
Unknown Object (File)
Oct 20 2024, 4:32 PM
Unknown Object (File)
Oct 20 2024, 4:33 AM
Unknown Object (File)
Oct 3 2024, 7:58 AM
Subscribers

Details

Summary

This adds custom errors to the lambda function instead of panics.

Previously, we used anyhow for errors and expect when unwrapping result/option types. This has all been replaced by custom error types in a new file called error.rs

Depends on D10788

Test Plan

Tested on staging. Working properly.

Diff Detail

Repository
rCOMM Comm
Branch
identity-search
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will held this revision as a draft.
will retitled this revision from [services] Replace panic with custom errors to [services] Replace panic with custom errors on search index lambda.Jan 18 2024, 3:49 PM
services/search-index-lambda/src/main.rs
20

I'll remove the pubs when I arc land

will published this revision for review.Jan 18 2024, 4:08 PM
will planned changes to this revision.Jan 22 2024, 6:15 AM
will retitled this revision from [services] Replace panic with custom errors on search index lambda to [services] [2/n] Replace panic with custom errors on search index lambda.Jan 22 2024, 11:12 AM
will edited the summary of this revision. (Show Details)
services/search-index-lambda/src/error.rs
16 ↗(On Diff #35974)

Wasn't completely sure about using this macro. Because StatusCode doesn't implement std::error, I use the #[error(ignore)]attribute as we use in services/blob/src/s3.rs for S3PathError

will edited the summary of this revision. (Show Details)
will edited the summary of this revision. (Show Details)

nice, much cleaner with the improved error handling. one thing i just realized -- do we have a task to track adding a search-index-lambda CI workflow? if not, we should make one and prioritize it i think

This revision is now accepted and ready to land.Jan 22 2024, 6:11 PM