Table of Contents

Class ErrorMessages

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

What to tell a person about a failure, instead of what the exception says.

public static class ErrorMessages
Inheritance
ErrorMessages
Inherited Members

Remarks

Every place that showed an error used to put ex.Message on screen. That text is written for developers, by .NET or the OS: "The process cannot access the file '…\server.jar' because it is being used by another process", in English or in the system's language, inside a sentence in the app's. This is the one place that turns a failure into words the app chose.

A UserFacingException is shown as it is: its message was already written for the user. The failures a person can do something about — a file in use, no permission, a full disk, no connection — get a sentence each that says what to do. Anything else gets a plain "something went wrong". In every case the exception itself, with its message and stack, goes to the day's log, so nothing a bug report needs is lost by not showing it.

Methods

Describe(Exception)

The sentence to show for error; its details go to the log.

public static string Describe(Exception error)

Parameters

error Exception

Returns

string