Skip to content

Commit

Permalink
fix(carbon): parse issue
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Oct 3, 2023
1 parent 953cd8f commit f077490
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions consumers/notification/v1/internal/vcarbon/carbon.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ func (p *Carbon) UnmarshalJSON(data []byte) error {
return nil
}
*p = *NewFromCarbon(carbon.Parse(str))
return &InvalidCarbonParseParameterError{
Parameter: str,
Msg: "invalid time string",
innerError: err,
if p.Error != nil {
return &InvalidCarbonParseParameterError{
Parameter: str,
Msg: p.Error.Error(),
innerError: p.Error,
}
}
return nil
}

0 comments on commit f077490

Please sign in to comment.