Skip to content

Commit

Permalink
Update error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Sep 12, 2024
1 parent a02ed77 commit d104164
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ballerina/tests/time_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ isolated function testCivilToStringWithEmptyTimeOffsetAndAbbreviation() returns
};
string|error civilString = civilToString(civil);
if civilString is error {
test:assertEquals(civilString.message(), "civil.utcOffset and civil.timeAbbrev both must not be null");
test:assertEquals(civilString.message(), "the civil value should have either `utcOffset` or `timeAbbrev`");
} else {
test:assertFail("civilString should be error");
}
Expand Down
2 changes: 1 addition & 1 deletion ballerina/time_apis.bal
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public isolated function civilToString(Civil civil) returns string|Error {

HeaderZoneHandling zoneHandling = PREFER_ZONE_OFFSET;
if utcOffset is () && timeAbbrev is () {
return error FormatError("civil.utcOffset and civil.timeAbbrev both must not be null");
return error FormatError("the civil value should have either `utcOffset` or `timeAbbrev`");
} else if utcOffset is () && timeAbbrev is string {
zoneHandling = PREFER_TIME_ABBREV;
}
Expand Down

0 comments on commit d104164

Please sign in to comment.