Commit bd0efb61 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch '321304-catch-typeerror-from-parse_time' into 'master'

Properly parse time in alert payload

See merge request gitlab-org/gitlab!60806
parents d92bc4d2 7c4b9234
......@@ -193,7 +193,7 @@ module Gitlab
def parse_time(value)
Time.parse(value).utc
rescue ArgumentError
rescue ArgumentError, TypeError
end
def parse_integer(value)
......
......@@ -89,6 +89,12 @@ RSpec.describe Gitlab::AlertManagement::Payload::Base do
it { is_expected.to be_nil }
end
context 'with time in seconds' do
let(:raw_payload) { { 'test' => 1618877936 } }
it { is_expected.to be_nil }
end
end
context 'with an integer type provided' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment