rock_rms 9.0.0 → 9.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d3f7a8e8361dbf8f52bc3e8e498f2e64720a67fc05d4f66c551445aef9667a3
4
- data.tar.gz: e3d5069ad435eb82800286f6ffc8408aad931ac8e0a14c3ebd48c52b920991e9
3
+ metadata.gz: 3a9bb351165c9ca4384f00dff69b644bdaa3a2195f63f1d5e74e3a054095e3db
4
+ data.tar.gz: 8ef1b75afee9559415653d274db092b232cf4be645e14cb8f85488eefeab16a3
5
5
  SHA512:
6
- metadata.gz: 87a52ebae4490a6255e15b179c0644a95bab338b7ce8fa10b9d3a4a38fe26d3ad31e2e866db327b5d7b1db325790aec9c5c858c535c31fb358caefc2742b24af
7
- data.tar.gz: 0ec1be1f0eff44cdbdd137fd34f6737f77c249fdfd6a22f78d4c6aca0ea4ce2c2d0606f5c584361d8003d4919ebf1c677aa7eb36aad73487bfb4099edce72191
6
+ metadata.gz: ecddffcdca64c67c4ff3521670a5e05f6a389550d2e597d260d70397599df03c3fe0a3d109c30b773fa2c72cbaa71382e7b5913be14ea50f0cd3b2224bd4d1f8
7
+ data.tar.gz: f65a8e6dd2ad84603a270a88389ea75ea9a37f18e0caeefddf8fcfec0683afc49fc7983543a6d2460f94fc84dd8fb418063d837768700e8e3bf1d1d39bb9d62a
@@ -41,10 +41,26 @@ module FaradayMiddleware
41
41
  when ERROR_STATUSES
42
42
  raise RockRMS::Error, error_message(env)
43
43
  end
44
+
45
+ check_html_error(env)
44
46
  end
45
47
 
46
48
  private
47
49
 
50
+ def html_body?(body)
51
+ body.lstrip.start_with?('<!DOCTYPE html>')
52
+ end
53
+
54
+ def check_html_error(env)
55
+ return unless html_body?(env[:body])
56
+
57
+ return unless /An error has occurred while processing your request/ =~ env[:body]
58
+
59
+ raise RockRMS::InternalServerError, error_message(
60
+ status: 500, url: env[:url], body: 'Unknown API error.'
61
+ )
62
+ end
63
+
48
64
  def error_message(env)
49
65
  "#{env[:status]}: #{env[:url]} #{env[:body]}"
50
66
  end
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '9.0.0'.freeze
2
+ VERSION = '9.1.0'.freeze
3
3
  end
@@ -73,4 +73,12 @@ RSpec.describe RockRMS::Error do
73
73
  end
74
74
  end
75
75
  end
76
+
77
+ context 'html error responses' do
78
+ it 'raises exception for html error' do
79
+ body = File.read('spec/rock_rms/fixtures/html_error.html')
80
+ stub(200, body)
81
+ expect_failure(500, 'Unknown API error.')
82
+ end
83
+ end
76
84
  end
@@ -0,0 +1,107 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>Rock - Error</title>
6
+
7
+ <link rel="stylesheet" href="/Themes/Rock/Styles/bootstrap.css" />
8
+ <link rel="stylesheet" href="/Themes/Rock/Styles/theme.css" />
9
+
10
+ <!-- Icons -->
11
+ <link rel="shortcut icon" href="/Assets/Icons/favicon.ico" />
12
+ <link
13
+ rel="apple-touch-icon-precomposed"
14
+ sizes="144x144"
15
+ href="/Assets/Icons/touch-icon-ipad-retina.png"
16
+ />
17
+ <link
18
+ rel="apple-touch-icon-precomposed"
19
+ sizes="114x114"
20
+ href="/Assets/Icons/touch-icon-iphone-retina.png"
21
+ />
22
+ <link
23
+ rel="apple-touch-icon-precomposed"
24
+ sizes="72x72"
25
+ href="/Assets/Icons/touch-icon-ipad.png"
26
+ />
27
+ <link
28
+ rel="apple-touch-icon-precomposed"
29
+ href="/Assets/Icons/touch-icon-iphone.png"
30
+ />
31
+
32
+ <script src="/Scripts/Bundles/RockJQueryLatest?v=RWC4egkRBNjCo9_aBrw2jUeb13vsJBPHaIryUym02aM1" />
33
+ <script>
34
+ $(document).ready(function () {
35
+ $(".stack-trace").hide();
36
+
37
+ //toggle the componenet with class msg_body
38
+ $(".exception-type").on("click", function () {
39
+ $(this).next(".stack-trace").slideToggle(500);
40
+ });
41
+ });
42
+ </script>
43
+ </head>
44
+ <body id="splash" class="error">
45
+ <form method="post" action="../../Error.aspx" id="form1">
46
+ <input
47
+ type="hidden"
48
+ name="__VIEWSTATE"
49
+ id="__VIEWSTATE"
50
+ value="zY3trHaJu9HpA6R0Qft80K1ia7i3JJbO0VBknpFbuqk8oF5SF3gh7FUwarjAwfgedCthmVdHOqSvT0WmCRZpYPhblTHuZLxOyIRLPaz+IxogqoYs0ET7RTbtJtieJmQDVE11QuH4fxaeQgxbI84aIhN6CSnQbpot5jFjPVD5k4PiMPY5S42Uq3BkX2OOzXqjhb4k2H+sxH19h7VBPpfJoMNiUqedQ3P7K97mJraVs3UhVGzKF5UHvQyy9mNxJ2OVhWx2tqSEIZU3k8e/JXRdVxNWbieFa79X+5u0mCYqrXAAyTDxBXkH8iIHbAH/D7SJAOn29a7zZU8L3E/J1quHI/vy/mpSuWgkYV/H0phoHQ46oF3XN1lDDJyCYskr8aZFtUSht12G3c5OTkNWH5hEFmDZiEtS/I31WhiAMMM0b5n1uojkgYzTg2jdwM2v4Jd/UkjMC9rgLBaOB0f///e67xsZkaT+GzzI8FpUFcgu17E1digy6Nlfe8uxRzEjrJOR0RJ3fAq3IAxQ+CFByvXzhpvoNsEOMyn8qOhJixIT10yReGQPn7RD9zToTZ8ZdluGoDPTgBfA+pDdduJV2AEXgqW7eXfRb+o0cr7mWgiNenibtWXNJCXThJOn9x6qr68dRY2QhZKqonH/EV3cKqdJfVYwLYgiiRxI6sMVBfdti9YJfbaT0D+scBxvgTmP+b0jdqvzNE0bUkgW3ylvcbqn2S+HVyupvqf7P2X54jU7/ewv4bd8eknSfDMxRoBUZ5KDdNePYKGrEPz5TlmjDht1FDjqme8XmMb1kEYWFzIrFOYPlrs0oLmoHV/tj+2daJ4yP1f9HxAlbofYbvGqVqA8CvpqhsnnzqLs/AoYT+rAuSAfMUMu3OlL8dL4gXWNrncR0TVmT39OTXqtx3GSM1gF7mmiNq6tjvYMpcUlI1LL6UDB8T+3S7g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
56
+ id="__VIEWSTATEGENERATOR"
57
+ value="AB827D4F"
58
+ />
59
+
60
+ <div id="content">
61
+ <div id="logo">
62
+ <svg
63
+ xmlns="http://www.w3.org/2000/svg"
64
+ width="60.185"
65
+ height="60.063"
66
+ >
67
+ <path
68
+ class="rock-logo"
69
+ fill="#FFF"
70
+ d="M57.705 60.063L41.387 40.936s11.83-.026 11.928-.028c1.313.1 2.654-.351 3.736-1.259 2.33-1.948 2.643-5.414.693-7.752L32.396 2.151c-.242-.319-.516-.62-.836-.891-.039-.029-.084-.051-.121-.082-.012-.01-.027-.018-.039-.025-.279-.216-.566-.405-.867-.563-.018-.009-.039-.014-.059-.021-.301-.151-.609-.276-.922-.366-.057-.013-.119-.025-.178-.039-.277-.063-.557-.129-.84-.15-.172-.021-.346-.008-.516-.008-.172 0-.34-.014-.514.008-.281.021-.559.087-.84.1-.059.014-.115.026-.174.039-.318.09-.625.215-.924.366-.021.009-.039.014-.057 0-.305.156-.598.347-.869.563-.018.009-.025.017-.037.025-.039.031-.084.053-.123.1-.32.271-.594.57-.84.885L0 29.86h14.461l13.557-15.891 13.604 15.967-12.104.008c-.045 0-.088.013-.133 0-.287 0-.578.026-.865.071-.082.017-.166.035-.244.054-.26.053-.52.132-.775.2-.094.034-.182.072-.266.117-.232.098-.455.213-.672.352-.096.062-.193.131-.285.2-.117.081-.238.143-.346.229-.076.067-.137.147-.211.221-.088.082-.174.172-.258.3-.166.171-.318.351-.453.531-.068.105-.131.205-.195.308-.127.198-.236.396-.332.6-.059.126-.107.255-.156.384-.072.199-.145.398-.191.605-.037.145-.063.301-.084.5-.035.202-.059.403-.07.606-.006.074-.023.137-.023.209v.3c.012.2 0 .4.1.557.025.2.1.4.1.555.039.2.1.3.1.5.072.2.2.4.2.588.061.1.1.2.2.35.123.2.3.4.4.6.045.1.1.1.1.168l18.004 21.104h14.459v-.09z"
71
+ />
72
+ </svg>
73
+ </div>
74
+
75
+ <div id="content-box">
76
+ <div class="row">
77
+ <div class="col-md-12">
78
+ <div id="pnlException">
79
+ <div class="error-wrap">
80
+ <h1>That Wasn't Supposed To Happen...</h1>
81
+
82
+ <p class="error-icon warning">
83
+ <i class="fa fa-exclamation-triangle"></i>
84
+ </p>
85
+
86
+ <p>
87
+ An error has occurred while processing your request. Your
88
+ organization's administrators have been notified of this
89
+ problem.
90
+ </p>
91
+
92
+ <p>
93
+ <a onclick="history.go(-1);" class="btn btn-sm btn-primary"
94
+ >Go Back</a
95
+ >
96
+ </p>
97
+ </div>
98
+
99
+ <div class="error-details"></div>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </form>
106
+ </body>
107
+ </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 9.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-30 00:00:00.000000000 Z
11
+ date: 2024-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -265,6 +265,7 @@ files:
265
265
  - rock_rms.gemspec
266
266
  - spec/rock_rms/client_spec.rb
267
267
  - spec/rock_rms/error_spec.rb
268
+ - spec/rock_rms/fixtures/html_error.html
268
269
  - spec/rock_rms/resources/attribute_spec.rb
269
270
  - spec/rock_rms/resources/attribute_values_spec.rb
270
271
  - spec/rock_rms/resources/batch_spec.rb