How to use the errorCodes function from tv4

Find comprehensive JavaScript tv4.errorCodes code examples handpicked from public code repositorys.

294
295
296
297
298
299
300
301
302
303
````
tv4.defineKeyword('my-custom-keyword', function (data, value, schema) {
        if (simpleFailure()) {
                return "Failure";
        } else if (detailedFailure()) {
                return {code: tv4.errorCodes.MY_CUSTOM_CODE, message: {param1: 'a', param2: 'b'}};
        } else {
                return null;
        }
});
fork icon190
star icon0
watch icon34

+ 3 other calls in file

45
46
47
48
49
50
51
52
53
54
    }
}

module.exports = {
    SchemaValidator,
    ErrorCodes: tv4.errorCodes
}

const toOpenApiSchema = schema => {
    const openApiSchema = cloneDeep(schema)
fork icon1
star icon1
watch icon18

+ 3 other calls in file