Skip to content

Commit

Permalink
fix isFGCTrackerError fn
Browse files Browse the repository at this point in the history
  • Loading branch information
williamsjokvist committed Nov 5, 2024
1 parent a617fc5 commit 1403e56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gui/src/main/app-error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function PageErrorBoundary() {
)
}

const isFGCTrackerError = (error: unknown) => error instanceof Object && 'translationKey' in error
const isFGCTrackerError = (error: unknown) => error instanceof Object && 'localizationKey' in error

function useFGCTrackerError() {
const thrownError = useRouteError()
Expand Down
7 changes: 5 additions & 2 deletions pkg/model/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ type FGCTrackerError struct {
}

func NewError(fmtErr *FGCTrackerError, err error) *FGCTrackerError {
fmtErr.InnerError = fmt.Errorf("%w: %w", fmtErr.InnerError, err)
return fmtErr
return &FGCTrackerError{
LocalizationKey: fmtErr.LocalizationKey,
Message: fmtErr.Message,
InnerError: fmt.Errorf("%w: %w", fmtErr.InnerError, err),
}
}

func newError(key ErrorLocalizationKey, err error) *FGCTrackerError {
Expand Down

0 comments on commit 1403e56

Please sign in to comment.