File tree Expand file tree Collapse file tree
src/plugins/data-import/server/content-types/datafile Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ const { ApplicationError } = require ( '@strapi/utils' ) . errors ;
34const array = require ( 'lodash/array' ) ;
45const collection = require ( 'lodash/collection' ) ;
56const object = require ( 'lodash/object' ) ;
@@ -22,10 +23,10 @@ const getEbiFieldData = async (data, ontology) => {
2223 ( { options} = res ) ;
2324
2425 if ( error ) {
25- throw new Error ( error ) ;
26+ throw new ApplicationError ( error ) ;
2627 }
2728 else if ( ! options || ! options . length ) {
28- throw new Error ( `Provided data ${ q } does not match to any ontology` ) ;
29+ throw new ApplicationError ( `Provided data ${ q } does not match to any ontology` ) ;
2930 }
3031
3132 if ( label ) {
@@ -34,7 +35,7 @@ const getEbiFieldData = async (data, ontology) => {
3435 ) ;
3536 }
3637 if ( options . length > 1 ) {
37- throw new Error ( `Provided data ${ q } does not match to a single ontology` ) ;
38+ throw new ApplicationError ( `Provided data ${ q } does not match to a single ontology` ) ;
3839 }
3940
4041 return options [ 0 ] ;
You can’t perform that action at this time.
0 commit comments