uffizzi_core 0.2.3 → 0.2.4

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: 00a0ca885833b018d539c809cd816026b45b1d97a4da1b4221bb3a0e2792c67e
4
- data.tar.gz: ec6bf450f58940daba7bc9406e07c29a709df6c5e31b36367140411000709e82
3
+ metadata.gz: 95b83037cf5b0e2be7f85038f8e42a2cce5b44f90a92ff0f0f006ca6d518d03f
4
+ data.tar.gz: 777a69d65951babbeb3cb8d4624a8fcb813cf23afe2ce3af35e52da923044f07
5
5
  SHA512:
6
- metadata.gz: 29f52388ec536c0aff974c7008b4de29b9029137d75a9b23780c8ca17f233d5046a7dd8fe5978daceaaa0dd5266bceed3408fa43256875f0d64709b33e8641e5
7
- data.tar.gz: ac25c0ffdf3d3577ef755854b0db6e12870d240c552a418f42437ffcc6d41ce606c9c54b803cacd5ac886f6120e075dd080723f10fdb9be192a6d4c62f833c4d
6
+ metadata.gz: af3ae4e46eee3ab0f72c7370d956e92a5eefcb48ff3c05b51682148258014eee0e833994b481c910220148ab4a99e9b91ae3cf33e45c5659cdbcbe8a2ae9b2bc
7
+ data.tar.gz: becb67e6136eb7096113058058e2f4e16e5a92f2c6313513f3efef9f517ef6f5220444a8e99cca831d17b8b44940d87805b897bc009bf9385e2cf645917258b2
@@ -62,7 +62,7 @@ class UffizziCore::Api::Cli::V1::Projects::ComposeFilesController < UffizziCore:
62
62
 
63
63
  def compose_file
64
64
  compose_file = resource_project.compose_file
65
- raise ActiveRecord::RecordNotFound if compose_file.blank?
65
+ raise ActiveRecord::RecordNotFound.new("Couldn't find UffizziCore::ComposeFile", UffizziCore::ComposeFile) if compose_file.blank?
66
66
 
67
67
  compose_file
68
68
  end
@@ -11,11 +11,13 @@ class UffizziCore::ApplicationController < ActionController::Base
11
11
  DEFAULT_PER_PAGE = 20
12
12
 
13
13
  protect_from_forgery with: :exception
14
- rescue_from ActiveRecord::RecordNotFound, with: :render_not_found
15
14
  RESCUABLE_EXCEPTIONS = [RuntimeError, TypeError, NameError, ArgumentError, SyntaxError].freeze
16
15
  rescue_from *RESCUABLE_EXCEPTIONS do |exception|
17
16
  render_server_error(exception)
18
17
  end
18
+ rescue_from ActiveRecord::RecordNotFound do |exception|
19
+ render_not_found(exception)
20
+ end
19
21
 
20
22
  before_action :authenticate_request!
21
23
  skip_before_action :verify_authenticity_token
@@ -29,8 +31,9 @@ class UffizziCore::ApplicationController < ActionController::Base
29
31
  UffizziCore::JsonResponder
30
32
  end
31
33
 
32
- def render_not_found
33
- render json: { errors: { title: ['Resource Not Found'] } }, status: :not_found
34
+ def render_not_found(exception)
35
+ resource = exception.model || 'Resource'
36
+ render json: { errors: { title: ["#{resource} Not Found"] } }, status: :not_found
34
37
  end
35
38
 
36
39
  def render_server_error(error)
@@ -30,7 +30,7 @@ en:
30
30
  invalid_memory_type: Memory '%{value}' contains an invalid type, it should be a string
31
31
  invalid_memory_value: Invalid memory value '%{value}'
32
32
  invalid_memory: The memory should be one of the `125m` `250m` `500m` `1000m` `2000m` `4000m` values
33
- image_build_no_specified: Service %{value} has neither an image nor a build context specified. At least one must be provided.
33
+ image_build_no_specified: Service '%{value}' has neither an image nor a build context specified. At least one must be provided.
34
34
  build_context_no_specified: The context option should be specified
35
35
  config_file_not_found: Config file not found '%{name}'
36
36
  invalid_context: Invalid context value '%{value}'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uffizzi_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Thurman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-06-21 00:00:00.000000000 Z
12
+ date: 2022-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm