bullion 0.3.2 → 0.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0627a65ca775cb70236a641f2192b7c82c7a5f558de349ab60a8c99f34148989
4
- data.tar.gz: cbf48fc60fda06c1f399d34e834416effc02e2ef699b706498350830190a4fe1
3
+ metadata.gz: eeb140b2f96dc4b7a1b90dd67def6ea51aa6cafe95d539802ff08d5051215944
4
+ data.tar.gz: ebadc84892a2cd895d1d5c89491df517b2a5e71a59aa245211a0e603d43a3fb5
5
5
  SHA512:
6
- metadata.gz: 1a63b00fd8d7d87e31b1c218f23da93ae98a79f90898355f94b2066abf1fb95396ed1634af7f8020c2bfc106928c01a0cd80a6ba253294d4fdfcc919f2fd34bf
7
- data.tar.gz: f9ebb294647518eba29860d1304401cdc4561ced78682966fb438025361898e3e3803b6e86001cdf9f26545608080dbae75ebaa20a5f6e435ac863861d1d3d55
6
+ metadata.gz: 37844c15c8c40d311f1dd8bbc31661b8810af1af7641ff799509a27b9bf325780a7c8c15f307efc59de9065c9c430e674f198bd67b5a8cf54e0a2a096ac4cb4f
7
+ data.tar.gz: 88bb5cb35c0cdf2c857538a631fa8ac681a70b56df56ec7d6bf6843597c778ddc07fa3cae54dc90a6585727b87a32bc76bad3942b850f2544b86feff03d1b91e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bullion (0.3.2)
4
+ bullion (0.3.3)
5
5
  httparty (~> 0.18)
6
6
  json (~> 2.6)
7
7
  jwt (~> 2.4)
@@ -11,17 +11,26 @@ module Bullion
11
11
  set :logging, true
12
12
  set :logger, Bullion::LOGGER
13
13
  set :database, DB_CONNECTION_SETTINGS
14
+ set :show_exceptions, false
14
15
  end
15
16
 
16
17
  before do
17
18
  # Sets up a useful variable (@json_body) for accessing a parsed request body
18
19
  if request.content_type&.include?("json") && !request.body.read.empty?
19
- p request.body
20
20
  request.body.rewind
21
21
  @json_body = JSON.parse(request.body.read, symbolize_names: true)
22
22
  end
23
23
  rescue StandardError => e
24
24
  halt(400, { error: "Request must be JSON: #{e.message}}" }.to_json)
25
25
  end
26
+
27
+ error do
28
+ content_type :json
29
+
30
+ e = env["sinatra.error"]
31
+ resp = { result: "error", message: e.message }
32
+ resp[:trace] = e.full_message if settings.environment.to_s != "production"
33
+ resp.to_json
34
+ end
26
35
  end
27
36
  end
@@ -4,6 +4,6 @@ module Bullion
4
4
  VERSION = [
5
5
  0, # major
6
6
  3, # minor
7
- 2 # patch
7
+ 3 # patch
8
8
  ].join(".")
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty