File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
apps/cyberstorm-remix/app/p/components/ReportPackage Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import {
1212 type PackageListingReportRequestData ,
1313 type RequestConfig ,
1414 packageListingReport ,
15+ UserFacingError ,
16+ formatUserFacingError ,
1517} from "@thunderstore/thunderstore-api" ;
1618
1719const reportOptions : SelectOption < PackageListingReportRequestData [ "reason" ] > [ ] =
@@ -81,7 +83,7 @@ export function ReportPackageForm(
8183 PackageListingReportRequestData ,
8284 Error ,
8385 SubmitorOutput ,
84- Error ,
86+ UserFacingError ,
8587 InputErrors
8688 > ( {
8789 inputs : formInputs ,
@@ -92,11 +94,7 @@ export function ReportPackageForm(
9294 resetFormInputs ( ) ;
9395 } ,
9496 onSubmitError : ( error ) => {
95- let message = `Error occurred: ${ error . message || "Unknown error" } ` ;
96- if ( error . message === "401: Unauthorized" ) {
97- message = "You must be logged in to report a package." ;
98- }
99- setError ( message ) ;
97+ setError ( formatUserFacingError ( error ) ) ;
10098 } ,
10199 } ) ;
102100
You can’t perform that action at this time.
0 commit comments