sds/overcommit · error · Overcommit::Exceptions::MessageProcessingError
Invalid message type '#{type}' for '#{message}': must be one
Error message
Invalid message type '#{type}' for '#{message}': must be one of #{Overcommit::Hook::MESSAGE_TYPES.inspect} What it means
Error "Invalid message type '#{type}' for '#{message}': must be one of #{Overcommit::Hook::MESSAGE_TYPES.inspect}" thrown in sds/overcommit.
Source
Thrown at lib/overcommit/utils/messages_utils.rb:67
match[:file]
end
def extract_line(match, message)
return unless match.names.include?('line')
Integer(match[:line])
rescue ArgumentError, TypeError
raise Overcommit::Exceptions::MessageProcessingError,
"Unexpected output: invalid line number found in '#{message}'"
end
def extract_type(match, message, type_categorizer)
if type_categorizer
type_match = match.names.include?('type') ? match[:type] : nil
type = type_categorizer.call(type_match)
unless Overcommit::Hook::MESSAGE_TYPES.include?(type)
raise Overcommit::Exceptions::MessageProcessingError,
"Invalid message type '#{type}' for '#{message}': must " \
"be one of #{Overcommit::Hook::MESSAGE_TYPES.inspect}"
end
type
else
:error # Assume error since no categorizer was defined
end
end
end
end
end
View on GitHub (pinned to fee0cd74b2)
Solutions
- Change the message type to one of the valid types: :error or :warning.
- Map the tool's severity strings to valid Overcommit message types in your hook's `extract_messages` implementation.
When it happens
Trigger: Thrown at lib/overcommit/utils/messages_utils.rb:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sds/overcommit@fee0cd74b2 (2026-08-23).
Data as JSON: /api/errors/986aadc1f60918a0.
Report an issue: GitHub.