# Functions
Deduce attempts to deduce a RemediationError from a plain error.
FilterToken replaces any matched patterns with "REDACTED".
Process persists the error log to disk and deduces the error type.
ServiceVersion returns an integer regardless of whether the given argument is a nil pointer or not.
SimplifyFastlyError reduces the potentially complex and multi-line Error rendering of a fastly.HTTPError to something more palatable for a CLI.
# Variables
AuthRemediation suggests checking the provided --token.
AutoCloneRemediation suggests provide an --autoclone flag.
BugRemediation suggests filing a bug on the GitHub repo.
ComputeBuildRemediation suggests configuring a `[scripts.build]` setting in the fastly.toml manifest.
ComputeInitRemediation suggests re-running `compute init` to resolve manifest issue.
ComputeServeRemediation suggests re-running `compute serve` with one of the incompatible flags removed.
ComputeTrialRemediation suggests contacting customer manager to enable the free trial feature flag.
ConfigRemediation informs the user that an error with loading the config isn't a breaking error and the CLI can still be used.
CustomerIDRemediation suggests provide a customer ID via --customer-id flag or via environment variable.
ErrDontContinue means the user said "NO" when prompted whether to continue.
ErrIncompatibleManifestVersion means the manifest_version defined is no longer compatible with the current CLI version.
ErrIncompatibleServeFlags means no --skip-build can't be used with --watch because it defeats the purpose of --watch which is designed to restart Viceroy whenever changes are detected (those changes would not be seen if we allowed --skip-build with --watch).
ErrInvalidArchive means the package archive didn't contain a recognised directory structure.
ErrInvalidComputeACLCombo means the user omitted either the operation, prefix, or action flag.
ErrInvalidDeleteAllJSONKeyCombo means the user provided both a --all and --json flag which are mutually exclusive behaviours.
ErrInvalidDeleteAllKeyCombo means the user provided both a --all and --key flag which are mutually exclusive behaviours.
ErrInvalidEnableDisableFlagCombo means the user provided both a --enable and --disable flag which are mutually exclusive behaviours.
ErrInvalidKVCombo means the user omitted either the key or value flag.
ErrInvalidProfileSSOCombo means the user specified both --sso and --automation-token and only one should be set.
ErrInvalidStdinFileDirCombo means the user provided more than one of --stdin, --file or --dir flags, which are mutally exclusive behaviours.
ErrInvalidVerboseJSONCombo means the user provided both a --verbose and --json flag which are mutually exclusive behaviours.
ErrMissingDeleteAllKeyCombo means the user omitted both the --all and --key flags and we need at least one of them.
ErrMissingManifestVersion means an invalid manifest (fastly.toml) has been used.
ErrNoCustomerID means no --customer-id or FASTLY_CUSTOMER_ID environment variable found.
ErrNoID means no --id value has been provided.
ErrNoServiceID means no --service-id or service_id fastly.toml value has been provided.
ErrNoSTDINData indicates the --stdin flag was specified but no data was piped into stdin.
ErrNoToken means no --token has been provided.
ErrParsingManifest means there was a problem unmarshalling the fastly.toml.
ErrPostBuildStopped means the user stopped the build because they were unhappy with the custom build defined in the fastly.toml manifest file.
ErrPostInitStopped means the user stopped the init process because they were unhappy with the custom post_init defined in the fastly.toml manifest file.
ErrReadingManifest means there was a problem reading the fastly.toml.
ErrSignalInterrupt means a SIGINT was received.
ErrSignalKilled means a SIGTERM was received.
ErrStopWalk is used to indicate to filepath.WalkDir that it should stop walking the directory tree.
ErrUnrecognisedManifestVersion means an invalid manifest (fastly.toml) version has been specified.
ErrViceroyRestart means the viceroy binary needs to be restarted due to a file modification noticed while running `compute serve --watch`.
ExistingDirRemediation suggests moving to another directory and retrying.
5mb.
FormatTemplate represents a generic error message prefix.
HostRemediation suggests there might be an issue with the local host.
IDRemediation suggests an ID via --id flag should be provided.
InvalidStaticConfigRemediation indicates an unexpected error occurred when deserialising the CLI's internal configuration.
Log is the primary interface for consumers.
LogPath is the location of the fastly CLI error log.
NetworkRemediation suggests, somewhat unhelpfully, to try again later.
Now is exposed so that we may mock it from our test file.
PackageSizeRemediation suggests checking the resources documentation for the current package size limit.
ProfileRemediation suggests no profiles exist.
ServiceIDRemediation suggests provide a service ID via --service-id flag or fastly.toml.
TokenExpirationRemediation indicates that a stored OIDC token has expired.
TokenFlagRegEx matches the token flag (https://regex101.com/r/YNr78Q/1).
TokenRegEx matches a Token as part of the error output (https://regex101.com/r/ulIw1m/1).
UnrecognisedManifestVersionRemediation suggests steps to resolve an issue where the project contains a manifest_version that is larger than what the current CLI version supports.
# Structs
Caller represents where an error occurred.
LogEntry represents a single error log entry.
MockLog is a no-op Log type.
RemediationError wraps a normal error with a suggested remediation.
SkipExitError is an error that can cause the os.Exit(1) to be skipped.
# Interfaces
LogInterface represents the LogEntries behaviours.
# Type aliases
LogEntries represents a list of recorded log entries.