Medic.Check (Medic v1.6.0) View Source
Reusable check functions
Link to this section Summary
Types
Valid return values from a check.
Functions
Usable within a check. If the command exits with a 0 status code, then :ok, is returned.
If the command returns a non-zero status code, then {:error, output, remedy} is returned,
where output is any text generated by the command.
Link to this section Types
Specs
check_return_t() ::
:ok
| :skipped
| {:warn, output :: binary()}
| {:error, output :: binary(), remedy :: binary()}
Valid return values from a check.
:ok- The check succeeded with no problems.:skipped- Doctor checks for files in.medic/skipped/to skip a check. Custom checks could return this to notify Doctor that they chose internally to skip the check.{:warn, output}- The check generated warnings, but does not stop Doctor from proceeding.{:error, output, remedy}- The check failed. Output may bestdoutand/orstderrgenerated from shell commands, or custom error output to show to the user. Theremedywill by copied into the local paste buffer.
Link to this section Functions
Specs
command_succeeds?(binary(), [binary()], [{:remedy, binary()}]) :: :ok | {:error, binary(), binary()}
Usable within a check. If the command exits with a 0 status code, then :ok, is returned.
If the command returns a non-zero status code, then {:error, output, remedy} is returned,
where output is any text generated by the command.