Skip to content

Commit

Permalink
refactor(FileMaker Node): Prevent reporting to Sentry attempted `load…
Browse files Browse the repository at this point in the history
…Options` calls without credentials (no-changelog) (n8n-io#7520)

Severity is lost when wrapping the error, but there is no need to change
the error type here.

https://n8nio.slack.com/archives/C03MZF137FV/p1698308092989739
  • Loading branch information
ivov authored Oct 26, 2023
1 parent a277807 commit d8ec6ea
Showing 1 changed file with 9 additions and 33 deletions.
42 changes: 9 additions & 33 deletions packages/nodes-base/nodes/FileMaker/FileMaker.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,7 @@ export class FileMaker implements INodeType {
// Get all the available topics to display them to user so that they can
// select them easily
async getLayouts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
let returnData: INodePropertyOptions[];

try {
returnData = await layoutsApiRequest.call(this);
} catch (error) {
throw new NodeOperationError(this.getNode(), error as Error);
}

return returnData;
return layoutsApiRequest.call(this);
},
async getResponseLayouts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
Expand All @@ -617,12 +609,8 @@ export class FileMaker implements INodeType {
value: '',
});

let layouts;
try {
layouts = await layoutsApiRequest.call(this);
} catch (error) {
throw new NodeOperationError(this.getNode(), error as Error);
}
const layouts = await layoutsApiRequest.call(this);

for (const layout of layouts) {
returnData.push({
name: layout.name,
Expand All @@ -635,12 +623,8 @@ export class FileMaker implements INodeType {
async getFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];

let fields;
try {
fields = await getFields.call(this);
} catch (error) {
throw new NodeOperationError(this.getNode(), error as Error);
}
const fields = await getFields.call(this);

for (const field of fields) {
returnData.push({
name: field.name,
Expand All @@ -653,12 +637,8 @@ export class FileMaker implements INodeType {
async getScripts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];

let scripts;
try {
scripts = await getScripts.call(this);
} catch (error) {
throw new NodeOperationError(this.getNode(), error as Error);
}
const scripts = await getScripts.call(this);

for (const script of scripts) {
if (!script.isFolder) {
returnData.push({
Expand All @@ -673,12 +653,8 @@ export class FileMaker implements INodeType {
async getPortals(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];

let portals;
try {
portals = await getPortals.call(this);
} catch (error) {
throw new NodeOperationError(this.getNode(), error as Error);
}
const portals = await getPortals.call(this);

Object.keys(portals as IDataObject).forEach((portal) => {
returnData.push({
name: portal,
Expand Down

0 comments on commit d8ec6ea

Please sign in to comment.