Module: SlackSender::ErrorMessages

Defined in:
lib/slack_sender/error_messages.rb

Constant Summary collapse

ARCHIVED_CHANNEL_SILENCED =
"Failed successfully: ignoring 'is archived' error per config"
NO_CONTENT_PROVIDED =
"Must provide at least one of: text, blocks, attachments, or files"
INVALID_BLOCKS =
"Provided blocks were invalid"
FILES_WITH_BLOCKS =
"Cannot provide files with blocks"
FILES_WITH_ATTACHMENTS =
"Cannot provide files with attachments"
FILES_WITH_ICON_EMOJI =
"Cannot provide files with icon_emoji"
UNKNOWN_CHANNEL =
"Unknown channel provided: :%s"
DEFAULT_SANDBOX_CHANNEL_MESSAGE_PREFIX =
":construction: _This message would have been sent to %s in production_"
PROFILE_UNREGISTERED =
"Cannot specify profile: :%s when calling on unregistered profile. " \
"Register the profile first with SlackSender.register(name, config)"
PROFILE_MISMATCH =
"Cannot specify profile: :%s when calling on profile :%s. Use SlackSender.profile(:%s).call(...) instead"
SANDBOX_REDIRECT_REQUIRES_CHANNEL =

Sandbox mode errors

"Sandbox mode :redirect requires sandbox.channel.replace_with to be set"
SANDBOX_NOOP_LOG =
"[SANDBOX NOOP] Profile: %s | Channel: %s | Text: %s"
FILE_EXCEEDS_SLACK_LIMIT =

File size errors

"File '%s' (%s bytes) exceeds Slack's maximum file size of 1 GB"
FILES_EXCEED_ASYNC_LIMIT =
"Total file size (%s bytes) exceeds max_async_file_upload_size (%s bytes). " \
"Use SlackSender.call! for synchronous upload, or increase config.max_async_file_upload_size"
MISSING_SCOPE =

Slack API scope errors. NOTE: these are shared by two call sites with different framing — DeliveryAxn's text-post path (prefixed by its base message, "Unable to send Slack message: ...") and FileUploader's async pre-upload path (raised standalone, with no base to attach to). Written as complete, self-contained sentences so they read correctly either way.

"Missing required Slack scope '%s'. " \
"Add this scope to your Slack app at https://api.slack.com/apps and reinstall the app."
MISSING_SCOPE_UNKNOWN =
"Missing a required Slack scope (not specified in response). " \
"Check your Slack app's OAuth scopes at https://api.slack.com/apps"
FILE_UPLOAD_REQUIRES_CHANNEL_ID =

File upload errors

"File uploads require a channel ID (e.g., C024BE91L or D032AC32T), " \
"not '%s'. Slack's files_upload_v2 API does not support usernames (@user) " \
"or channel names (#channel). Use the channel/DM ID instead."
UNKNOWN_KWARGS =

Argument validation errors

"Unknown argument(s): %s. Valid arguments are: %s"
FILE_AND_FILES_CONFLICT =
"Cannot provide both file: and files:"
CHANNEL_AND_CHANNELS_CONFLICT =
"Cannot provide both channel: and channels:"
EMPTY_CHANNELS =
"channels: cannot be empty"
MULTI_CHANNEL_SYNC_NOT_SUPPORTED =
"Multi-channel delivery via `channels:` is only supported for async calls. " \
"Use `call` instead of `call!`, or send to each channel individually."