Skip to content

Commit

Permalink
return more descriptive errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Sep 2, 2020
1 parent 35d6f2d commit 6f5d362
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,11 @@ static int parse_palette(yaml_file_t *data, yaml_document_t *doc, yaml_node_t *r

if (palette == NULL)
{
LL_ERROR("Invalid palette formatting. Be sure to use the \'name\' parameter for the palettes list.");
parser_show_mark_error(keyn->start_mark);
return 1;
}

if (parse_str_cmp("max-entries", key))
{
tmpi = strtol(value, NULL, 0);
Expand Down Expand Up @@ -757,10 +760,11 @@ static int parse_convert(yaml_file_t *data, yaml_document_t *doc, yaml_node_t *r

if (convert == NULL)
{
LL_ERROR("Invalid convert formatting.");
LL_ERROR("Invalid convert formatting. Be sure to use the \'name\' parameter for the converts list.");
parser_show_mark_error(keyn->start_mark);
return 1;
}

if (parse_str_cmp("palette", key))
{
if (convert->paletteName != NULL)
Expand Down Expand Up @@ -976,6 +980,13 @@ static int parse_output(yaml_file_t *data, yaml_document_t *doc, yaml_node_t *ro
{
int tmpi;

if (output == NULL)
{
LL_ERROR("Invalid output formatting. Be sure to use the \'type\' parameter for the outputs list.");
parser_show_mark_error(keyn->start_mark);
return 1;
}

if (parse_str_cmp("include-file", key))
{
if (output->includeFileName != NULL)
Expand Down

0 comments on commit 6f5d362

Please sign in to comment.