// (C) 2007-2019 GoodData Corporation import { IError } from "../../model/Error"; export function moreThanOneRootElement(): IError { return { error: { errorClass: "com.gooddata.json.validator.exception.MalformedMessageException", trace: "", message: "Malformed request: [Parsing error: More than one root element. Can not generate legal XML.]", component: "Webapp", errorId: "4170eef4-b14d-4da0-b0de-f50a5eb47b81", errorCode: "gdc702", parameters: [], }, }; } export function invalidElementKey(validElementKey: string, invalidElementKey: string): IError { return { error: { errorClass: "com.gooddata.json.validator.exception.MalformedMessageException", trace: "", message: 'Malformed request: [[[line: 1, column: 34] element "' + invalidElementKey + '" not allowed' + ' anywhere; expected element "' + validElementKey + '"]]', component: "Webapp", errorId: "2a9826d5-64b3-447a-a042-94eedf5451c3", errorCode: "gdc702", parameters: [], }, }; } export function invalidCatalogRequestStructureType(invalidStructureType: string): IError { return { error: { trace: "Trace begun at /opt/common/lib/Apache/REST.pm line 1419\nApache::REST::_check_tagged_structures" + "('Internal=HASH(0x7f00dfa3abe0)', 'HASH(0x7f00dfa3b6a8)', '', 'POST', 0, 0, 1, 0) called at " + "/opt/common/lib/Apache/REST.pm line 248\neval {...} at /opt/common/lib/Apache/REST.pm line 178\n" + "Apache::REST::service('Internal=HASH(0x7f00dfa3abe0)', " + "'Apache2::RequestRec=SCALAR(0x7f00df8a27c8)') " + "called at /opt/common/lib/Apache/REST.pm line 146\nApache::REST::handler('Internal', " + "'Apache2::RequestRec=SCALAR(0x7f00df8a27c8)') called at -e line 0\neval {...} at -e line 0\n", parameters: [ "catalogRequest", "STRUCTURE INVALID - name of structure:'CatalogRequest'" + "(tag:catalogRequest), /catalogRequest: Object 'ARRAY(0x7f00df953390)' should be a hash reference, " + "ref is " + invalidStructureType, ], requestId: "2Cs9LN9FNkDmwx9y:brecos4z5sylzx9e", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; } export function invalidCatalogRequestTypesStructure(invalidStructureType: string): IError { return { error: { trace: "Trace begun at /opt/common/lib/Apache/REST.pm line 1419\nApache::REST::_check_tagged_structures" + "('Internal=HASH(0x7f00df446b38)', 'HASH(0x7f00df5e3c68)', '', 'POST', 0, 0, 1, 0) called at " + "/opt/common/lib/Apache/REST.pm line 248\neval {...} at /opt/common/lib/Apache/REST.pm line 178\n" + "Apache::REST::service('Internal=HASH(0x7f00df446b38)', " + "'Apache2::RequestRec=SCALAR(0x7f00df3c7190)') " + "called at /opt/common/lib/Apache/REST.pm line 146\nApache::REST::handler('Internal', " + "'Apache2::RequestRec=SCALAR(0x7f00df3c7190)') called at -e line 0\neval {...} at -e line 0\n", parameters: [ "catalogRequest", "STRUCTURE INVALID - name of structure:'CatalogRequest'" + "(tag:catalogRequest), /catalogRequest/types: Object 'HASH(0x7f00df62aee0)' should be a array " + "reference, ref is " + invalidStructureType, ], requestId: "sP2AUJGQheTRDxYa:v0v4b66wi0cwtu9q", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; } export function invalidCatalogRequestTypes(): IError { return { error: { trace: "Trace begun at /opt/common/lib/Apache/REST.pm line 1419\nApache::REST::_check_tagged_structures" + "('Internal=HASH(0x7f00df6c6c60)', 'HASH(0x7f00df6cc518)', '', 'POST', 0, 0, 1, 0) called at " + "/opt/common/lib/Apache/REST.pm line 248\neval {...} at /opt/common/lib/Apache/REST.pm line 178\n" + "Apache::REST::service('Internal=HASH(0x7f00df6c6c60)', " + "'Apache2::RequestRec=SCALAR(0x7f00df6928e8)') " + "called at /opt/common/lib/Apache/REST.pm line 146\nApache::REST::handler('Internal', " + "'Apache2::RequestRec=SCALAR(0x7f00df6928e8)') called at -e line 0\neval {...} at -e line 0\n", parameters: [ "catalogRequest", "STRUCTURE INVALID - name of structure:'CatalogRequest'" + "(tag:catalogRequest), /catalogRequest/types/: Object does not match any alternative. " + "Alternatives tried : [STRUCTURE INVALID - name of structure:'CatalogRequest'(tag:catalogRequest), " + "/catalogRequest/types//case:: Constant 'attribute' expected., STRUCTURE INVALID - name of " + "structure:'CatalogRequest'(tag:catalogRequest), /catalogRequest/types//case:: Constant " + "'metric' expected., STRUCTURE INVALID - name of structure:'CatalogRequest'(tag:catalogRequest), " + "/catalogRequest/types//case:: Constant 'fact' expected.]", ], requestId: "prQaxWXeYlEWKkiF:l69kw8q4rv7vjmf3", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; } export function invalidCatalogRequestPagingStructure(invalidStructureType: string): IError { return { error: { trace: "Trace begun at /opt/common/lib/Apache/REST.pm line 1419\nApache::REST::_check_tagged_structures" + "('Internal=HASH(0x7f00dfec0200)', 'HASH(0x7f00dfebc8a0)', '', 'POST', 0, 0, 1, 0) called at " + "/opt/common/lib/Apache/REST.pm line 248\neval {...} at /opt/common/lib/Apache/REST.pm line 178\n" + "Apache::REST::service('Internal=HASH(0x7f00dfec0200)', " + "'Apache2::RequestRec=SCALAR(0x7f00dfec0320)') " + "called at /opt/common/lib/Apache/REST.pm line 146\nApache::REST::handler('Internal', " + "'Apache2::RequestRec=SCALAR(0x7f00dfec0320)') called at -e line 0\neval {...} at -e line 0\n", parameters: [ "catalogRequest", "STRUCTURE INVALID - name of structure:'CatalogRequest'" + "(tag:catalogRequest), /catalogRequest/paging: Object '' should be a hash reference, ref is " + invalidStructureType, ], requestId: "zSB4GovsAe8Ie7wu:nrebxdyg1jizvq0p", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; } export function invalidCatalogRequestPaging(): IError { return { error: { trace: "Trace begun at /opt/common/lib/Apache/REST.pm line 1419\nApache::REST::_check_tagged_structures" + "('Internal=HASH(0x7f00dfdf8c00)', 'HASH(0x7f00dfdef778)', '', 'POST', 0, 0, 1, 0) called at " + "/opt/common/lib/Apache/REST.pm line 248\neval {...} at /opt/common/lib/Apache/REST.pm line 178\n" + "Apache::REST::service('Internal=HASH(0x7f00dfdf8c00)', " + "'Apache2::RequestRec=SCALAR(0x7f00dfe041f0)') called at /opt/common/lib/Apache/REST.pm line " + "146\nApache::REST::handler('Internal', " + "'Apache2::RequestRec=SCALAR(0x7f00dfe041f0)') called at -e line 0\neval {...} at -e line 0\n", parameters: [ "catalogRequest", "STRUCTURE INVALID - name of structure:'CatalogRequest'" + "(tag:catalogRequest), /catalogRequest/paging: Key 'offset' is compulsory.", ], requestId: "TbcaZOqX6h9sAkoy:sboy8ncqmuk5gzl9", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; } export function invalidCatalogRequestScalarType(identifier: string): IError { return { error: { trace: "Trace begun at /opt/common/lib/Apache/REST.pm line 1419\nApache::REST::_check_tagged_structures" + "('Internal=HASH(0x7f00e01d13a0)', 'HASH(0x7f00e01d4e70)', '', 'POST', 0, 0, 1, 0) called at " + "/opt/common/lib/Apache/REST.pm line 248\neval {...} at /opt/common/lib/Apache/REST.pm line 178\n" + "Apache::REST::service('Internal=HASH(0x7f00e01d13a0)', " + "'Apache2::RequestRec=SCALAR(0x7f00e01c22b0)') called at /opt/common/lib/Apache/REST.pm line " + "146\nApache::REST::handler('Internal', Apache2::RequestRec=SCALAR(0x7f00e01c22b0)') " + "called at -e line 0\neval {...} at -e line 0\n", parameters: [ "catalogRequest", "STRUCTURE INVALID - name of structure:'CatalogRequest'" + "(tag:catalogRequest), /catalogRequest/" + identifier + ": You used array, object or hash instead of " + "scalar (int, string,..).", ], requestId: "SvkKPzLPJzUbMCIR:mckau4204sjvqdd5", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; } export function invalidCatalogRequestBucketItemsStructure(invalidStructureType: string): IError { return { error: { trace: "Trace begun at /opt/common/lib/Apache/REST.pm line 1419\nApache::REST::_check_tagged_structures" + "('Internal=HASH(0x7f00e02864e0)', 'HASH(0x7f00e0267300)', '', 'POST', 0, 0, 1, 0) called at " + "/opt/common/lib/Apache/REST.pm line 248\neval {...} at /opt/common/lib/Apache/REST.pm line 178\n" + "Apache::REST::service('Internal=HASH(0x7f00e02864e0)', " + "'Apache2::RequestRec=SCALAR(0x7f00e02862a8)') called at " + "/opt/common/lib/Apache/REST.pm line 146\nApache::REST::handler('Internal', " + "'Apache2::RequestRec=SCALAR(0x7f00e02862a8)') called at -e line 0\neval {...} at -e line 0\n", parameters: [ "catalogRequest", "STRUCTURE INVALID - name of structure:'CatalogRequest'" + "(tag:catalogRequest), /catalogRequest/bucketItems: Object '' should be a array reference, ref is " + invalidStructureType, ], requestId: "zox8FhjeMVDsoAWD:d0eapca8xh2mhq97", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; } export function undefinedUsing2Structure(tagName: string): IError { return { error: { parameters: [tagName, "Structure with tag name '" + tagName + "' is not defined."], requestId: "5nhtjhyRtKWoJ4qb:px1tfodzhq9tb5lx", component: "Apache::REST", errorClass: "GDC::Exception::User", message: "Checking '%s', result %s", }, }; }