0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 05:32:41 +00:00

Rephrasing of error texts

This commit is contained in:
Trevor Buckner
2023-06-26 22:48:58 -04:00
parent c0164dce6a
commit d0de7ca28c
2 changed files with 47 additions and 43 deletions

View File

@@ -21,37 +21,40 @@ const errorIndex = (props)=>{
'02' : dedent` '02' : dedent`
## We can't find this brew in Google Drive! ## We can't find this brew in Google Drive!
This error tells us the file was saved on Google Drive, but the link This file was saved on Google Drive, but this link doesn't work anymore.
you have tried to open doesn't work anymore. The Homebrewery cannot delete files ${ props.brew.authors?.length > 0
from Google Drive on its own, so there are three most likely possibilities: ? `Note that this brew belongs to the Homebrewery account **${ props.brew.authors[0] }**,
${ props.brew.account
? `which is
${props.brew.authors[0] == props.brew.account
? `your account.`
: `not your account (you are currently signed in as **${props.brew.account}**).`
}`
: 'and you are not currently signed in to any account.'
}`
: ''
}
The Homebrewery cannot delete files from Google Drive on its own, so there
are three most likely possibilities:
: :
- **The Google Drive files may have been accidentally deleted.** Look in - **The Google Drive files may have been accidentally deleted.** Look in
${props.brew.authors?.length > 0 the Google Drive account that owns this brew (or ask the owner to do so),
&&
(props.brew.authors[0] == props.brew.account
? 'your Google Drive account'
: dedent`the Google Drive account associated with the
**${props.brew.authors[0]}** Homebrewery account - you
are currently logged in with the **${props.brew.account}**
account -`)
||
'your Google Drive account'}
and make sure the Homebrewery folder is still there, and that it holds your brews and make sure the Homebrewery folder is still there, and that it holds your brews
as text files. as text files.
- **You may have changed the sharing settings for your files.** If the files - **You may have changed the sharing settings for your files.** If the files
are still on Google Drive, change all of them to be shared *with everyone who has are still on Google Drive, change all of them to be shared *with everyone who has
the link* so the Homebrewery can access them. the link* so the Homebrewery can access them.
- **Your Google Account may be full**, or may be have been closed by - **The Google Drive may be full**, or may be have been closed by
Google (for inactivity, violating some policy of theirs). Make sure you can still Google (for inactivity, violating some policy of theirs). Make sure the owner can
access your Google Drive normally and upload/download files to it. still access Google Drive normally and upload/download files to it.
: :
If you can't find it, Google Drive usually puts your file in your Trash folder for If the file isn't found, Google Drive usually puts your file in your Trash folder for
30 days. Assuming you didn't empty the trash right after, it might be worth checking. 30 days. Assuming the trash hasn't been emptied yet, it might be worth checking.
You can also look on the right side of the page while logged into Google Drive and You can also find the Activity tab on the right side of the Google Drive page, which
look at the Activity tab. This can help you pin down the exact date the brew was shows the recent activity on Google Drive. This can help you pin down the exact date
deleted and by whom. the brew was deleted or moved, and by whom.
: :
If you *still* can't find it, some people have had success asking Google to recover If the brew still isn't found, some people have had success asking Google to recover
accidentally deleted files at this link: accidentally deleted files at this link:
https://support.google.com/drive/answer/1716222?hl=en&ref_topic=7000946. https://support.google.com/drive/answer/1716222?hl=en&ref_topic=7000946.
At the bottom of the page there is a button that says *Send yourself an Email* At the bottom of the page there is a button that says *Send yourself an Email*
@@ -63,35 +66,38 @@ const errorIndex = (props)=>{
// User is not Authors list // User is not Authors list
'03' : dedent` '03' : dedent`
## The current logged in user does not have editor access to this brew. ## Current signed-in user does not have editor access to this brew.
If you believe you should have access to this brew, ask the file owner to invite you If you believe you should have access to this brew, ask one of its authors to invite you
as an author by opening the brew, viewing the Properties tab, and adding your username as an author by opening the Edit page for the brew, viewing the {{fa,fa-info-circle}}
to the "invited authors" list. You can then try to access this document again. **Properties** tab, and adding your username to the "invited authors" list. You can
then try to access this document again.
**Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'}
**Current Authors:** **Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'}`,
${props.brew.authors?.map((author)=>{return `- ${author}`;}).join('\n') || 'Unable to list authors'} // User is not signed in; must be a user on the Authors List
`,
// User is not logged in
'04' : dedent` '04' : dedent`
## Not logged in ## Sign-in required to edit this brew.
User is not logged in. Please log in [here](${loginUrl}).`, You must be logged in to one of the accounts listed as an author of this brew.
User is not logged in. Please log in [here](${loginUrl}).
**Brew Title:** ${props.brew.brewTitle || 'Unable to show title'}
**Current Authors:** ${props.brew.authors?.map((author)=>{return `${author}`;}).join(', ') || 'Unable to list authors'}`,
// Brew load error // Brew load error
'05' : dedent` '05' : dedent`
## No Homebrewery document could be found. ## No Homebrewery document could be found.
The server could not locate the Homebrewery document. The server could not locate the Homebrewery document. It was likely deleted by
its owner.
**Requested access:** ${props.brew.accessType} **Requested access:** ${props.brew.accessType}
**Brew ID:** ${props.brew.brewId} **Brew ID:** ${props.brew.brewId}`,
`,
// Brew save error // Brew save error
'06' : dedent` '06' : dedent`
@@ -105,8 +111,7 @@ const errorIndex = (props)=>{
An error occurred while attempting to remove the Homebrewery document. An error occurred while attempting to remove the Homebrewery document.
**Brew ID:** ${props.brew.brewId} **Brew ID:** ${props.brew.brewId}`,
`,
// Author delete error // Author delete error
'08' : dedent` '08' : dedent`
@@ -114,8 +119,7 @@ const errorIndex = (props)=>{
An error occurred while attempting to remove the user from the Homebrewery document author list! An error occurred while attempting to remove the user from the Homebrewery document author list!
**Brew ID:** ${props.brew.brewId} **Brew ID:** ${props.brew.brewId}`,
`,
}; };
}; };

View File

@@ -58,7 +58,7 @@ const api = {
}); });
// Throw any error caught while attempting to retrieve Google brew. // Throw any error caught while attempting to retrieve Google brew.
if(googleError) { if(googleError) {
const reason = googleError.errors[0].reason; const reason = googleError.errors?.[0].reason;
if(reason == 'notFound') { if(reason == 'notFound') {
throw { ...googleError, HBErrorCode: '02', authors: stub?.authors, account: req.account?.username }; throw { ...googleError, HBErrorCode: '02', authors: stub?.authors, account: req.account?.username };
} }
@@ -77,7 +77,7 @@ const api = {
if(req.account){ if(req.account){
throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title }; throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title };
} }
throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04' }; throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title };
} }
// If after all of that we still don't have a brew, throw an exception // If after all of that we still don't have a brew, throw an exception