glia-errors 0.14.0 → 0.14.1

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: c54253c9c31cff619c7be5f0519497d16e4fbffd7d99b028342d5a8c09afdea1
4
- data.tar.gz: 2cd269d97b594a3b1c5a0bb629ace07919f2820e1e33919f9d1128b0a4a9d089
3
+ metadata.gz: ed191a541738bdb411e948565ed5a52047b4e091137843353306212965ac13c0
4
+ data.tar.gz: 00e89550af7bd420ccd503031790d39a40fec53a30004213f1d8dea05c731c50
5
5
  SHA512:
6
- metadata.gz: 9e0cd589a2f4a609a8d412327134d6287e952aca20c000c6b41b5a7f5413021af543c5193b7040f74096ab3c037cd5b0c5487a47f73180f603aba9d868ef9cc9
7
- data.tar.gz: 6654fd33524e1f7ff0adf13b66b95281df248224465037ab6441e672276fa701affb9cfd9a59a3b6b4bfd3e3116933810e7347bbd80851cccf7d770889c2da08
6
+ metadata.gz: 7c829ab7ae9521732d506c329998cb361ea75e33228b9ed75a235056fb2e0e3b9784cfaae5db83b2bf5582799ef45e878735985b26e8faa59d299f02c6053744
7
+ data.tar.gz: e873b734312305383851a5c24d171fb1a7082d4c644ffb60c9c03ec7bf5a501f1b14705e01263254ff222cffa785428394859a5485741a440ed9af255cc09ede
data/README.md CHANGED
@@ -114,7 +114,7 @@ A Github Action will push the `.gem` file to [rubygems.org](https://rubygems.org
114
114
  ### Testing
115
115
 
116
116
  ```
117
- bundle exec rake test
117
+ bundle exec rake spec
118
118
  ```
119
119
 
120
120
  ### Formatting
data/catalog-info.yaml ADDED
@@ -0,0 +1,16 @@
1
+ ---
2
+ apiVersion: backstage.io/v1alpha1
3
+ kind: Component
4
+ metadata:
5
+ name: glia-errors-ruby
6
+ description: Implements Glia errors in Ruby and provides utilities to easily construct them.
7
+ annotations:
8
+ github.com/project-slug: salemove/glia-errors
9
+ github.com/team-slug: salemove/tm-movers
10
+ snyk.io/org-name: glia-movers
11
+ tags:
12
+ - ruby
13
+ spec:
14
+ type: library
15
+ lifecycle: production
16
+ owner: tm-messenger
data/glia-errors.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'glia-errors'
8
- spec.version = '0.14.0'
8
+ spec.version = '0.14.1'
9
9
  spec.authors = ['Glia TechMovers']
10
10
  spec.email = ['techmovers@glia.com']
11
11
 
@@ -207,6 +207,20 @@ module Glia
207
207
  end
208
208
  end
209
209
 
210
+ class ResourceLockedError < Error
211
+ def initialize(resource:, locked_by: nil, message: nil)
212
+ Naming.assert_snake_case(resource)
213
+
214
+ is_locked_by = locked_by.nil? ? '' : "Locked by: #{locked_by}"
215
+ super(
216
+ type: RESOURCE_LOCKED,
217
+ ref: create_ref(RESOURCE_LOCKED),
218
+ message: message || "#{Naming.humanize(resource)} is locked. #{is_locked_by}",
219
+ error_details: { resource: resource, locked_by: locked_by }
220
+ )
221
+ end
222
+ end
223
+
210
224
  class ResourceAlreadyExistsError < Error
211
225
  def initialize(resource:, message: nil)
212
226
  Naming.assert_snake_case(resource)
@@ -16,6 +16,7 @@ module Glia
16
16
  REMAINING_ASSOCIATION_ERROR = 'remaining_association_error'
17
17
  RESOURCE_LIMIT_EXCEEDED_ERROR = 'resource_limit_exceeded_error'
18
18
  RESOURCE_MINIMUM_NOT_REACHED = 'resource_minimum_not_reached'
19
+ RESOURCE_LOCKED = 'resource_locked'
19
20
  RESOURCE_ALREADY_EXISTS_ERROR = 'resource_already_exists_error'
20
21
  INVALID_RESOURCE_STATE_ERROR = 'invalid_resource_state_error'
21
22
  AUTHORIZATION_ERROR = 'authorization_error'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glia-errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glia TechMovers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-02 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email:
@@ -23,11 +23,11 @@ files:
23
23
  - ".rspec"
24
24
  - ".rubocop.yml"
25
25
  - ".ruby-version"
26
- - ".travis.yml"
27
26
  - Gemfile
28
27
  - Gemfile.lock
29
28
  - README.md
30
29
  - Rakefile
30
+ - catalog-info.yaml
31
31
  - glia-errors.gemspec
32
32
  - lib/glia/errors.rb
33
33
  - lib/glia/errors/client_errors.rb
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- language: ruby
2
- dist: trusty
3
- rvm:
4
- - 2.5.0
5
- before_install:
6
- - gem install bundler:2.2.0
7
- before_script:
8
- - nvm install 12
9
- - nvm use 12
10
- - bundle
11
- gemfile:
12
- - gemfiles/dry_validation_v1.gemfile
13
- script: bundle exec rake