Skip to content

Instantly share code, notes, and snippets.

@Saif-Shines
Created March 19, 2025 21:57
Show Gist options
  • Save Saif-Shines/60c1758ea36cebeeed9af3f19df85e73 to your computer and use it in GitHub Desktop.
Save Saif-Shines/60c1758ea36cebeeed9af3f19df85e73 to your computer and use it in GitHub Desktop.

Additional guidelines for back-end engineers This lesson contains recommendations specifically for back-end software engineers.

Supply error codes If an error code exists, include it as part of the error message. Error codes help technical users identify the error and find more information from an error index or error catalog.

thumb_down Not recommended Error: You already own this bucket. Select another name from the dropdown list.

thumb_up Recommended Error 409: You already own this bucket. Select another name from the dropdown list.

Include an Error Identifier Engineers parse logs to learn how and why errors occurred; therefore, include an Error Identifier to help engineers find particular errors more easily. The Error Identifier should stay constant, even if the textual error message changes.

For more information, see the Errors unit of AIP-193. (https://google.aip.dev/193)

thumb_down Not recommended { "error" : "Bad Request - Request is missing a required parameter: -collection_name. Update parameter and resubmit.

thumb_up Recommended { "error" : "Bad Request - Request is missing a required parameter: -collection_name. Update parameter and resubmit. Issue Reference Number BR0x0071" }

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Avoid double negatives A double negative is a sentence or phrase that contains two negative words, such as:

  not, including contractions like can't, won't

  no

Readers find double negatives hard to parse. ("Wait, do two negatives make a positive or is the author of the error message using two negatives to emphasize something I shouldn't do?")

Some double negatives in error messages are blatant:

thumb_down Not recommended You cannot not invoke this flag.

thumb_up Recommended You must invoke this flag.

Other double negatives are more subtle. For example, the words prevents and forbidding in the following error message are both negatives, leading to a confusing message:

thumb_down Not recommended The universal read permission on pathname prevents the operating system from forbidding access.

thumb_up Recommended The universal read permission on pathname enables anyone to read this file. Giving access to everyone is a security flaw. See hyperlink for details on how to restrict readers.

Similarly, avoid exceptions to exceptions.

thumb_down Not recommended The App Engine service account must have permissions on the image, except the Storage Object Viewer role, unless the Storage Object Admin role is available.

thumb_up Recommended The App Engine service account must have one of the following roles:

    Storage Object Admin

    Storage Object Creator

Next unit: Write for the target audience (/tech-writing/error-messages/target-audience)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Be concise Write concise error messages. Emphasize what's important. Cut unnecessary text. See the Short sentences unit of Tech Writing One (/tech-writing/one/short-sentences) for tips on reducing sentence length.

thumb_down Not recommended Unable to establish connection to the SQL database. [Explanation of how to fix the issue.]

thumb_up Recommended Can't connect to the SQL database. [Explanation of how to fix the issue.]

thumb_down Not recommended The resource was not found and cannot be differentiated. What you selected doesn't exist in the cluster. [Explanation of how to find valid resources in the cluster.]

thumb_up Recommended Resource isn't in cluster . [Explanation of how to find valid resources in the cluster.]

Converting from passive voice to active voice (/tech-writing/one/active-voice) often makes sentences conciser and easier to understand:

thumb_down Not recommended The Froobus operation is no longer supported by the Frambus app.

thumb_up Recommended The Frambus app no longer supports the Froobus operation.

In your enthusiasm to be concise, don't remove so many words that the resulting error message becomes cryptic. For example, don't reduce the preceding error message down to the following:

thumb_down Not recommended Unsupported.

Multiple choice exercise

Reorder and shorten the following start of an error message. How many words can you remove?

      The SiteID <SiteID> you have entered is invalid.



3                                                                                                                                check_box_outline_blank

4                                                                                                                                check_box_outline_blank

None.                                                                                                                            check_box_outline_blank

5                                                                                                                                check_box_outline_blank

Next unit: Avoid double negatives (/tech-writing/error-messages/avoid-double-negatives)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Course summary This course recommended the following best practices when writing error messages:

  Identify the cause of the error.

         If the user entered an invalid value, specify the invalid value.

         Specify requirements and constraints, such as required permissions or minimum RAM.

  Explain how to fix the problem.

         When appropriate, provide an example to help demonstrate the fix.

  Write clearly.

         Be concise, not wordy. However, don't be so concise that the resulting error message becomes cryptic.

         Avoid double negatives and exceptions to exceptions.

         Aim the message at the appropriate target audience. Words appropriate for software engineers are often inappropriate for non-
         technical users.

         Use terminology consistently. For example, don't use the term directory in one part of an error message and a folder in another
         part.

         Format long error messages carefully, possibly using progressive disclosure or links to expanded documentation.

         Set a positive tone.

         Don't be overly apologetic.

Next unit: Additional guidelines for back end engineers (/tech-writing/error-messages/back-end)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Explain how to fix the problem Create actionable error messages. That is, after explaining the cause of the problem, explain how to fix the problem.

thumb_down Not recommended The client app on your device is no longer supported.

thumb_up Recommended The client app on your device is no longer supported. To update the client app, click the Update app button.

Next unit: Provide examples (/tech-writing/error-messages/provide-examples)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Format error messages to enhance readability A few simple techniques help error messages stand out from the surrounding text and code.

Link to more detailed documentation When an error requires a lengthy explanation (for example, multiple sentences) and appropriate documentation is available, use links to redirect users to more detailed documentation.

thumb_down Not recommended Post contains unsafe information.

thumb_up Recommended Post contains unsafe information. Learn more about safety at .

Use progressive disclosure link Some error messages are long, requiring a lot of text to explain the problem and solution. Unfortunately, users sometimes ignore long error messages, intimidated by the "wall of text." A good compromise is to display a briefer version of the error message and then give users the option to click something to get the full context.

thumb_down Not recommended TextField widgets require a Material widget ancestor, but none were located. In material design, most widgets are conceptually “printed” on a sheet of material. To introduce a Material widget, either directly include one or use a widget that contains a material itself.

thumb_up Recommended TextField widgets require a Material widget ancestor, but none were located. ...(Click to see more.)

In material design, most widgets are conceptually "printed" on a sheet of material. To introduce a Material widget, either directly include one or use a widget that contains a material itself.

Place error messages close to the error For coding errors, place error messages as close as possible to the place where the error occurred.

thumb_down Not recommended

1: program figure_1; 2: Grade = integer; 3: var 4. print("Hello") Use ':' instead of '=' when declaring a variable.

thumb_up Recommended

1: program figure_1; 2: Grade = integer; ---------^ Syntax Error Use ':' instead of '=' when declaring a variable. 3: var 4. print("Hello")

Handle font colors carefully A surprising percentage of readers are color blind, so be careful with colors in error messages. For example, the following error message will mystify some readers:

thumb_down Not recommended The argument expects only digits. Therefore, the supplied value is only partially correct: 3728LJ947

Many forms of color blindness exist, so just avoiding a red/green combination isn't sufficient. Because you can't depend on all your users being comfortable with color, we recommend pairing color with another visual cue. For example, the following error message pairs color with boldface:

thumb_up Recommended The argument expects only digits. Therefore, the highlighted part of the supplied value is incorrect: 3728LJ947

The following example pairs color with extra spaces:

thumb_up Recommended The argument expects only digits. Therefore, the highlighted part of the supplied value is incorrect: 3728 LJ 947

Alternatively, you could skip color completely:

thumb_up Recommended The argument expects only digits. Therefore, the highlighted characters in the supplied value are incorrect:

3728LJ947 ^^

Next unit: Set the right tone (/tech-writing/error-messages/set-tone)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. General error handling rules Before we get to the fun part of the course—wording error messages—let's discuss a few general error handling rules.

Don't fail silently Failure is inevitable; failing to report failures is inexcusable. Failing silently causes the following problems:

  Users wonder whether something has gone wrong. ("Why did my order not go through?")

  Customer support wonders what caused a problem. ("The log file gave no indication of a problem.")

Embrace your software's fallibility. Assume that humans will make mistakes using your software. Try to minimize ways for people to misuse your software, but assume that you can't completely eliminate misuse. Therefore, plan error messages as you design software.

Follow the programming language guides Follow the guidelines on error handling in Google's programming language guides, including:

  Google C++ Style Guide (https://google.github.io/styleguide/cppguide.html)

  Google Java Style Guide (https://google.github.io/styleguide/javaguide.html)

  Google Python Style Guide (https://google.github.io/styleguide/pyguide.html), particularly the Error Messages section
   (https://google.github.io/styleguide/pyguide.html#3102-error-messages)

  Google JavaScript Style Guide (https://google.github.io/styleguide/jsguide.html)

  Google Go Style Guide (https://google.github.io/styleguide/go), particularly the Error handling section
   (https://google.github.io/styleguide/go/best-practices#error-handling)

Implement the full error model Implement the full error model described in the Errors page of the Google AIP. (https://google.aip.dev/193) For instance, note the following quote about implementing error messages in services:

Services must return a google.rpc.Status (https://github.com/googleapis/api-common-protos/blob/master/google/rpc/status.proto) message when an API error occurs, and must use the canonical error codes defined in google.rpc.Code (https://github.com/googleapis/api-common-protos/blob/master/google/rpc/code.proto).

The Errors page of the Google Cloud API design guide (https://cloud.google.com/apis/design/errors) provides helpful information about implementing the full error model for Google APIs.

Avoid swallowing the root cause API implementations should not swallow the root cause of issues occurring in the back end. For example, many different situations can cause a "Server error" problem, including:

  service failure

  network connection drop

  mismatching status

  permission issues

"Server error" is too general an error message to help users understand and fix the problem. If the server logs contain identification information about the in-session user and operation, we recommend providing additional context on the particular failure case. Log the error codes Numeric error codes help customer support monitor and diagnose errors. Consequently, specifying numeric error codes along with textual error messages is often quite valuable.

You can specify error codes for both internal and external errors. For internal errors, provide a proper error code for easy lookup/debugging by internal support personnel and engineers.

Document all error codes.

Raise errors immediately Raise errors as early as useful. Holding on to errors and then raising them later increases debugging costs dramatically.

Next unit: Identify the error's cause (/tech-writing/error-messages/identify-the-cause)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-16 UTC. Identify the error's cause Tell users exactly what went wrong. Be specific—vague error messages frustrate users.

thumb_down Not recommended Bad directory.

thumb_up Recommended The [Name of directory] directory exists but is not writable. To add files to this directory, the directory must be writable. [Explanation of how to make this directory writable.]

thumb_down Not recommended Invalid field 'picture'.

thumb_up Recommended The 'picture' field can only appear once on the command line; this command line contains the 'picture' field times. Note: Prior to version 2.1, you could specify the 'picture' field more than once, but more recent versions no longer support this.

Next unit: Identify the user's invalid inputs (/tech-writing/error-messages/invalid-inputs)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-16 UTC. Identify the user's invalid inputs If the error involves values that the user can enter or modify (for example, text, settings, command-line parameters), then the error message should identify the offending value(s).

thumb_down Not recommended Funds can only be transferred to an account in the same country.

thumb_up Recommended You can only transfer funds to an account within the same country. Sender account's country (UK) does not match the recipient account's country (Canada).

thumb_down Not recommended Invalid postal code.

thumb_up Recommended The postal code for the US must consist of either five or nine digits. The specified postal code (4872953) contained seven digits.

If the invalid input is a very long value that spans many lines, consider doing one of the following:

  Disclose the bad input progressively; that is, provide one or more clickable ellipses to enable users to control how much additional
  error information they want to see.

  Truncate the bad input, keeping only its essential parts.

Multiple choice exercise

Which of the following error messages is best?



The specified bid ($5) is below the minimum bid ($8).                                                                                                  check_box_outline_blank

The specified bid is below the minimum bid ($8).                                                                                                       check_box_outline_blank

The specified bid is too low.                                                                                                                          check_box_outline_blank

The specified bid ($5) is too low.                                                                                                                     check_box_outline_blank

Next unit: Specify requirements and constraints (/tech-writing/error-messages/specify-requirements)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Provide examples Supplement explanations with examples that illustrate how to correct the problem.

thumb_down Not recommended Invalid email address.

thumb_up Recommended The specified email address (robin) is missing an @ sign and a domain name. For example: [email protected].

thumb_down Not recommended Invalid input.

thumb_up Recommended Enter the pathname of a Windows executable file. An executable file ordinarily ends with the .exe suffix. For example: C:\Program Files\Custom Utilities\StringFinder.exe

thumb_down Not recommended Do not declare types in the initialization list.

thumb_up Recommended Do not declare types in the initialization list. Use calls instead, such as 'BankAccount(owner, IdNum, openDate)' rather than 'BankAccount(string owner, string IdNum, Date openDate)'

thumb_down Not recommended Syntax error on token "||", "if" expected.

thumb_up Recommended Syntax error in the "if" condition. The condition is missing an outer pair of parentheses. Add a pair of bounding opening and closing parentheses to the condition. For example: if (a > 10) || (b == 0) # Incorrect if ((a > 10) || (b == 0)) # Correct

Multiple choice exercise

Which of the following error messages is best for an audience of people who drive cars?



The specified license plate (QB2 481) is invalid. Valid license plates start with three uppercase letters and end with three
digits. For example: MBR 918 and NRS 727 are both valid license plates.                                                          check_box_outline_blank

The specified license plate (QB2 481) is invalid. For example: MBR 918 and NRS 727 are both valid license plates. check_box_outline_blank

The specified license plate (QB2 481) is invalid because license plates must start with three letters and end with three digits.                       check_box_outline_blank

Next unit: Be concise (/tech-writing/error-messages/be-concise)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Set the right tone The tone of your error messages can have a significant effect on how your users interpret them.

Be positive Instead of telling the user what they did wrong, tell the user how to get it right.

thumb_down Not recommended You didn't enter a name.

thumb_up Recommended Enter a name.

thumb_down Not recommended You entered an invalid postal code.

thumb_up Recommended Enter a valid postal code. [Explanation of valid postal code.]

thumb_down Not recommended ANSI C++ forbids declaration 'ostream' with no type 'ostream'.

thumb_up Recommended ANSI C++ requires a type for declaration 'ostream' with type 'ostream'.

Don't be overly apologetic While maintaining positivity, avoid the words "sorry" or "please." Focus instead on clearly describing the problem and solution.

Note: Different cultures interpret apologies differently. Some cultures expect apologies in certain situations; other cultures find apologies from software corporations somewhat insincere. Although this lesson suggests avoiding apologies, be aware of your target audience's expectations.

thumb_down Not recommended We're sorry, a server error occurred and we're temporarily unable to load your spreadsheet. We apologize for the inconvenience. Please wait a while and try again.

thumb_up Recommended Google Docs is temporarily unable to open your spreadsheet. In the meantime, try right-clicking the spreadsheet in the doc list to download it.

Avoid humor Don't attempt to make error messages humorous. Humor in error messages can fail for the following reasons:

  Errors frustrate users. Angry users are generally not receptive to humor.

Users can misinterpret humor. (Jokes don't always cross borders well.)

    Humor can detract from the goal of the error message.

thumb_down Not recommended Is the server running? Better go catch it :D.

thumb_up Recommended The server is temporarily unavailable. Try again in a few minutes.

Don't blame the user If possible, focus the error message on what went wrong rather than assigning blame.

thumb_down Not recommended You specified a printer that's offline.

thumb_up Recommended The specified printer is offline.

Multiple choice exercise

Which of the following error messages do not use the appropriate tone?

     1. Sorry, you are not allowed to leave feedback.

     2. You entered an invalid title for your item.

     3. 404 Error. Oops, that is embarrassing.




3                                                                                                                                                      check_box_outline_blank


1                                                                                                                                                      check_box_outline_blank


2                                                                                                                                                      check_box_outline_blank


1, 2, and 3.                                                                                                                                           check_box_outline_blank

Next unit: Want to play a game? (/tech-writing/error-messages/want-to-play-a-game)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Specify requirements and constraints Help users understand requirements and constraints. Be specific. Don't assume that users know the limitations of your system.

thumb_down Not recommended The combined size of the attachments is too big.

thumb_up Recommended The combined size of the attachments (14MB) exceeds the allowed limit (10MB). [Details about possible solution.]

thumb_down Not recommended Permission denied.

thumb_up Recommended Permission denied. Only users in have access. [Details about adding users to the group.]

thumb_down Not recommended Time-out period exceeded.

thumb_up Recommended Time-out period (30s) exceeded. [Details about possible solution.]

Next unit: Explain how to fix the problem (/tech-writing/error-messages/show-fix)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Use terminology consistently Use terminology consistently for all error messages within a single product area. If you call something a "datastore" in one error message, then call the same thing a "datastore" in all the other error messages.

thumb_down Not recommended Can't connect to cluster at 127.0.0.1:56. Check whether minikube is running.

thumb_up Recommended Can't connect to minikube at 127.0.0.1:56. Check whether minikube is running.

Note: Some authoring systems automatically recommend synonyms to ensure that you don't keep repeating the same word. Yes, variety spices up paragraphs. However, variety in error messages can confuse users.

Error messages must appear consistently with similar formats and non-contradictory content; that is, the same problem must generate the same error message. For example, if different parts of an app each detect problems with internet connection, both parts should emit the same error message.

Next unit: Format error messages to enhance readability (/tech-writing/error-messages/format-for-readability)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Write for the target audience Tailor the error message to the target audience. That is:

  Use appropriate terminology for that target audience.

  Be mindful of what the target audience knows and doesn't know.

Beware of the curse of knowledge (/tech-writing/one/audience#curse_of_knowledge) when writing error messages. A term familiar to you might not be familiar to your target audience. For example, the following error message contains terminology appropriate for a target audience of ML experts. If the target audience includes a significant number of people who aren't ML experts, then the error message is mystifying:

thumb_up Recommended for ML experts only Exploding gradient problem. To fix this problem, consider gradient clipping.

Now compare the following two error messages. The first error message contains technical truth, but terms like server, client, farm, and CPU are not going to help most consumers:

thumb_down Inappropriate for shoppers A server dropped your client's request because the server farm is running at 92% CPU capacity. Retry in five minutes.

The second error message is more suitable (and comforting) for a non-technical audience:

thumb_up Appropriate for shoppers So many people are shopping right now that our system can't complete your purchase. Don't worry--we won't lose your shopping cart. Please retry your purchase in five minutes.

Multiple choice exercise

Which audience(s) is the following error message appropriate for?

      This app does not support JPG files. You may only upload SVG or PNG files.



Inappropriate for any audience.                                                                                                                        check_box_outline_blank

People using an app to upload receipts.                                                                                                                check_box_outline_blank

Software Engineers, System Administrators, and technical end-users                                                                                     check_box_outline_blank

Next unit: Use terminology consistently (/tech-writing/error-messages/use-terminology-consistently)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC. Writing Helpful Error Messages This self-study course helps you write clearer, more effective error messages, whether they appear in IDEs, command lines, or GUIs. While this course contains lessons for many error message scenarios, the majority of examples and guidance focus on developer-facing error messages.

Note: Not all guidelines presented in this course are appropriate in every situation for every target audience. Always aim error messages at the product's target audience.

Target audience for this course We've aimed this course at the following audiences:

    Engineers

    Program managers

    Technical writers

We recommend taking Technical Writing One (https://developers.google.com/tech-writing/overview) before taking this error messages course. After all, good error messages are just another form of good technical writing. If you'd prefer to skip Technical Writing One for now, that's okay—you can still benefit from this error messages course.

Why take this course? Bad error messages frustrate users. Good error messages provide critical information when things are not working as expected. Error messages are often the main way developers interact with users when problems occur. Some error messages are caused by invalid user inputs or misuse of certain features and some are caused by product defects; all error messages require users to figure out what to do next.

Data collected through Google support systems and UX research identified the following common problems with bad error messages:

    unactionable

    vague

    imprecise

    confusing

    inaccurate

    unclear cause

    unknown next steps

Conversely, good error messages provide the following benefits:

    Deliver the best user experience.

    Are actionable.

    Are universally accessible. (To learn more, take Tech Writing for Accessibility. (/tech-writing/accessibility))

    Enable users to help themselves.

    Reduce the support workload.

    Enable faster resolution of issues.

Learning objectives After completing this class, you will know how to do the following:

  Write clearer, more helpful error messages.

  Review your teammates' error messages.

Learning non-objectives This course does not explain the mechanics of generating error messages. For example, this course does not explain how to display error messages within a GUI.

This course in ten seconds Great error messages answer two questions as clearly and concisely as possible:

  What went wrong?

  How does the user fix that problem?

Yes, it's just that simple.

And, it's just that hard.

Next unit: General error handling rules (/tech-writing/error-messages/error-handling)

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-08-06 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment