@k03mad/ip2geo 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app/lib/ip2geo.js CHANGED
@@ -147,6 +147,10 @@ export default async (ip = '', {
147
147
 
148
148
  const {body} = await request(API + ip);
149
149
 
150
+ if (!body?.ip) {
151
+ throw new Error(`API error:\n${body}`);
152
+ }
153
+
150
154
  const usedData = [
151
155
  body.ip,
152
156
  body?.flag?.emoji,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k03mad/ip2geo",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "GeoIP library",
5
5
  "maintainers": [
6
6
  "Kirill Molchanov <k03.mad@gmail.com"