Skip to content

Commit

Permalink
tune wording
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
  • Loading branch information
ohltyler committed Dec 17, 2024
1 parent c1de940 commit f553b2c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions public/utils/config_to_schema_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,18 @@ export function getFieldSchema(
}
}
)
.test('jsonArray', `Too large`, (value) => {
try {
// @ts-ignore
return new TextEncoder().encode(value)?.length < MAX_BYTES;
} catch (error) {
return false;
.test(
'jsonArray',
`Too large. Exceeds OpenSearch Dashboards limit of ${MAX_BYTES} bytes.`,
(value) => {
try {
// @ts-ignore
return new TextEncoder().encode(value)?.length < MAX_BYTES;
} catch (error) {
return false;
}
}
});
);
break;
}
case 'jsonString': {
Expand Down

0 comments on commit f553b2c

Please sign in to comment.