Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PDK-1181) Display error when metadata.json missing or unreadable #574

Merged
merged 1 commit into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/pdk/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ def module_pdk_version
else
nil
end
rescue ArgumentError => e
PDK.logger.error(e)
nil
end
module_function :module_pdk_version
end
Expand Down
8 changes: 8 additions & 0 deletions spec/unit/pdk/util_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -535,5 +535,13 @@

it { is_expected.to be nil }
end

context 'if there is a problem reading the metadata.json file' do
before(:each) do
allow(described_class).to receive(:module_metadata).and_raise(ArgumentError, 'some error')
end

it { is_expected.to be_nil }
end
end
end