Skip to content

Commit

Permalink
fix: resolve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshita-mindfire committed Jan 27, 2022
1 parent 622ee58 commit f5769d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/pods-core/src/builtin/AirtablePod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export class AirtableUtils {
default:
return {
error: new DendronError({
message: `The type ${type} provided in srcFieldMapping is invalid. Please update the pod config by running Dendron: Configure Export Pod V2 command.`,
message: `The type ${type} provided in srcFieldMapping is invalid. Please check the valid types here: https://wiki.dendron.so/notes/oTW7BFzKIlOd6iQnnNulg.html#sourcefieldmapping and update the pod config by running Dendron: Configure Export Pod V2 command.`,
severity: ERROR_SEVERITY.MINOR,
}),
};
Expand Down
7 changes: 4 additions & 3 deletions packages/pods-core/src/v2/pods/export/AirtableExportPodV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ResponseUtil,
RespV2,
RespV3,
StatusCodes,
} from "@dendronhq/common-all";
import { createLogger } from "@dendronhq/common-server";
import { JSONSchemaType } from "ajv";
Expand Down Expand Up @@ -67,7 +68,7 @@ class AirtableUtilsV2 {
return _records;
} catch (error: any) {
let message;
if (error?.statusCode === 422) {
if (error?.statusCode === StatusCodes.UNPROCESSABLE_ENTITY) {
const airtableError = error as AirtableError;
if (airtableError.error === "INVALID_MULTIPLE_CHOICE_OPTIONS") {
// example airtable error message: 'Insufficient permissions to create new select option ""scope.xyz""'
Expand All @@ -78,15 +79,15 @@ class AirtableUtilsV2 {
);
message = field
? `The choice ${value} for field ${field} does not exactly match with an existing option. Please check what values are allowed in Airtable`
: "";
: airtableError.message;
} else if (airtableError.error === "INVALID_VALUE_FOR_COLUMN") {
message = airtableError.message;
}
}
const _error = new DendronError({
innerError: error as Error,
payload: record,
message: `Error with Airtable. ${message}`,
message: `Error during Airtable Export. ${message}`,
});
errors.push(_error);
return;
Expand Down

0 comments on commit f5769d0

Please sign in to comment.