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 RequestConfig ,
1313 type PackageListingReportRequestData ,
1414 packageListingReport ,
15+ UserFacingError ,
16+ formatUserFacingError ,
1517} from "@thunderstore/thunderstore-api" ;
1618
1719import { useStrongForm } from "cyberstorm/utils/StrongForm/useStrongForm" ;
@@ -92,7 +94,7 @@ export function ReportPackageForm(
9294 PackageListingReportRequestData ,
9395 Error ,
9496 SubmitorOutput ,
95- Error ,
97+ UserFacingError ,
9698 InputErrors
9799 > ( {
98100 inputs : formInputs ,
@@ -102,11 +104,7 @@ export function ReportPackageForm(
102104 setError ( null ) ;
103105 } ,
104106 onSubmitError : ( error ) => {
105- let message = `Error occurred: ${ error . message || "Unknown error" } ` ;
106- if ( error . message === "401: Unauthorized" ) {
107- message = "You must be logged in to report a package." ;
108- }
109- setError ( message ) ;
107+ setError ( formatUserFacingError ( error ) ) ;
110108 } ,
111109 } ) ;
112110
You can’t perform that action at this time.
0 commit comments