Skip to content

Commit 28969a1

Browse files
committed
README: we forgot to update classname of excetptions
1 parent e825637 commit 28969a1

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
matrix:
1414
os: [ubuntu-latest]
1515
# https://www.ruby-lang.org/en/downloads/branches/
16-
ruby: ["3.1", "3.2", "3.3"]
16+
ruby: ["3.1", "3.2", "3.3", "3.4"]
1717
runs-on: ${{ matrix.os }}
1818
steps:
1919
- uses: actions/checkout@v4

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
3.2.1 - Mon Jan 20 2025
2+
===============================================================
3+
- Documentation: With 3.0 we changed the classname of exceptions
4+
- test suite: test against Ruby 3.4
5+
16
3.2.0 - Mon Jun 10 2024
27
===============================================================
38
- Ruby 2.x no longer supported

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ begin
107107
# Invalid API key
108108
geocoder = OpenCage::Geocoder.new(api_key: 'invalid-api-key')
109109
geocoder.geocode('Manchester')
110-
rescue OpenCage::Geocoder::AuthenticationError => e
110+
rescue OpenCage::Error::AuthenticationError => e
111111
p 'invalid apikey'
112-
rescue OpenCage::Geocoder::QuotaExceeded => e
112+
rescue OpenCage::Error::QuotaExceeded => e
113113
p 'over quota'
114114
rescue StandardError => e
115115
p 'other error: ' + e.message
116116
end
117117

118118
# Using strings instead of numbers for reverse geocoding
119119
geocoder.reverse_geocode('51.5019951', '-0.0698806')
120-
# raises OpenCage::Geocoder::InvalidRequest (not valid numeric coordinates: "51.5019951", "-0.0698806")
120+
# raises OpenCage::Error::InvalidRequest (not valid numeric coordinates: "51.5019951", "-0.0698806")
121121

122122
begin
123123

@@ -147,7 +147,7 @@ File.foreach('queries.txt') do |line|
147147
# there is an invalid line in the queries.txt file
148148
result = geocoder.reverse_geocode(Float(latitude), Float(longitude))
149149
results.push(result)
150-
rescue ArgumentError, OpenCage::Geocoder::GeocodingError => error
150+
rescue ArgumentError, OpenCage::Error::GeocodingError => error
151151
# Stop looping through the queries if there is an error
152152
puts "Error: #{error.message}"
153153
break

0 commit comments

Comments
 (0)