Skip to content

Translate Joi validation errors to be a bit more helpful #702

Description

@dalanmiller

@Alanz2223 had an issue where he was accidentally adding auto_create_table to the Horizon constructor:

From Slack:

alanz2223 [12:10]  
here is my opts object 
`const options = { 
 project_name : 'test',
 auth: { token_secret: 'my_super_secret_secret' },
 auto_create_collection : true,
 auto_create_table : true
};`

But the error he was getting back wasn't so informative that auto_create_table isn't an actual option for Horizon server:

[1] "auto_create_table" is not allowed`

Now this error is pretty clear that it isn't a valid property, but maybe it could be something like:

< List of errors in Joi validation >
You have included invalid options in the Horizon constructor. 
Review the list of valid options here => https://horizon.io/docs/embed/

This could lead more people to double check?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions