Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ export default async function EditorLayout({
branch, // fallback branch if default branch logic fails
true // preferDefaultBranch = true
);
const latestDocsYmlAndReferences = docsYmlAndReferences.type === "ok" ? docsYmlAndReferences.result : null;
const fernFolderPath =
docsYmlAndReferences.type === "ok" ? docsYmlAndReferences.metadata.fernFolderPath : undefined;

if (docsYmlAndReferences.type !== "ok") {
console.error(docsYmlAndReferences.error);
throwDigestibleError(
new Error(`Failed to load docs configuration: ${docsYmlAndReferences.error.type}`),
docsYmlAndReferences.error.type
);
}

const latestDocsYmlAndReferences = docsYmlAndReferences.result;
const fernFolderPath = docsYmlAndReferences.metadata.fernFolderPath;

return (
<EditorShell>
<ThemeProvider attribute="class" forcedTheme="light" enableSystem={false} disableTransitionOnChange>
Expand Down
3 changes: 3 additions & 0 deletions packages/fern-dashboard/src/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ export type ERROR_DIGEST_KEYS =
| "BASE_BRANCH_NOT_SET"
| "USER_NOT_IN_ORG"
| "WRITE_PERMISSION_ERROR"
| "DOCS_YML_MISSING"
| GithubValidationErrorKeys;

export const ERROR_DIGEST_MESSAGES: Record<ERROR_DIGEST_KEYS, string> = {
BRANCH_NOT_FOUND:
"We were unable to find your working branch. Please confirm that the GitHub branch exists and has not been deleted.",
BASE_BRANCH_NOT_SET:
"Looks like your source repo is not configured correctly. Please set a base branch on your GitHub repo.",
DOCS_YML_MISSING:
"The docs.yml configuration file was not found in your repository. Please ensure a valid docs.yml file exists in your Fern project.",
REPO_NOT_CONNECTED: "Please connect your GitHub repo above.",
REPO_NOT_FOUND: "We were unable to locate the GitHub repo connected to this site. Please contact support.",
USER_NOT_IN_ORG: "You do not have access to this organization. Please contact an organization admin to be added.",
Expand Down