opera 0.2.8 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/lib/opera/operation/instructions/executors/operation.rb +3 -2
- data/lib/opera/operation/instructions/executors/step.rb +2 -1
- data/lib/opera/operation/instructions/executors/transaction.rb +7 -3
- data/lib/opera/operation/instructions/executors/validate.rb +16 -2
- data/lib/opera/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16174465116cab3f0fbadd69a03b6b0428bdb9c24ea126034f75dbf0641bc3d5
|
4
|
+
data.tar.gz: 67d7987ebb8c290e564f0e3e35e02bf29a34b098699174ca48dc6207b37f99f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab6cbc94a66983bfdbd1326cdd7bd809a584747f8734205072cf2bfe40a00d369cfc54a9d626a3fc336482d574908a6c4d6b130fc050d0c40584638698702b14
|
7
|
+
data.tar.gz: 4930ff7e4e3cc7c4635f373d7808143657cab984c9a78893daf08471a125af995f0ecd19ea2511ccd11808555d1a2c4b7a0d07da81bf5e36e5dc106d277a41fe
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Opera Changelog
|
2
2
|
|
3
|
+
### 0.2.11 - June 1, 2022
|
4
|
+
|
5
|
+
- handle internally exceptions from schema
|
6
|
+
|
7
|
+
### 0.2.10 - June 1, 2022
|
8
|
+
|
9
|
+
- `finish!` does not break transaction
|
10
|
+
|
11
|
+
### 0.2.9 - May 16, 2022
|
12
|
+
|
13
|
+
- Improve executions for failing operations
|
14
|
+
|
3
15
|
### 0.2.8 - December 7, 2021
|
4
16
|
|
5
17
|
- Fix issue with default value
|
data/Gemfile.lock
CHANGED
@@ -12,12 +12,13 @@ module Opera
|
|
12
12
|
|
13
13
|
if operation_result.success?
|
14
14
|
add_instruction_output(instruction, operation_result.output)
|
15
|
-
execution = result.executions.pop
|
16
|
-
result.executions << { execution => operation_result.executions }
|
17
15
|
else
|
18
16
|
result.add_errors(operation_result.errors)
|
19
17
|
result.add_exceptions(operation_result.exceptions)
|
20
18
|
end
|
19
|
+
|
20
|
+
execution = result.executions.pop
|
21
|
+
result.executions << { execution => operation_result.executions }
|
21
22
|
end
|
22
23
|
|
23
24
|
private
|
@@ -12,7 +12,8 @@ module Opera
|
|
12
12
|
operation.send(method)
|
13
13
|
rescue StandardError => exception
|
14
14
|
reporter&.error(exception)
|
15
|
-
operation.result.add_exception(method, exception.message, classname: operation.class.name)
|
15
|
+
operation.result.add_exception(method, "#{exception.message}, for #{operation.inspect}", classname: operation.class.name)
|
16
|
+
operation.result
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -12,11 +12,11 @@ module Opera
|
|
12
12
|
transaction_class.send(*arguments) do
|
13
13
|
super
|
14
14
|
|
15
|
-
return if
|
15
|
+
return if result.success?
|
16
16
|
|
17
|
-
raise(
|
17
|
+
raise(transaction_error)
|
18
18
|
end
|
19
|
-
rescue
|
19
|
+
rescue transaction_error
|
20
20
|
nil
|
21
21
|
end
|
22
22
|
|
@@ -31,6 +31,10 @@ module Opera
|
|
31
31
|
def transaction_options
|
32
32
|
config.transaction_options
|
33
33
|
end
|
34
|
+
|
35
|
+
def transaction_error
|
36
|
+
RollbackTransactionError
|
37
|
+
end
|
34
38
|
end
|
35
39
|
end
|
36
40
|
end
|
@@ -15,8 +15,22 @@ module Opera
|
|
15
15
|
instruction[:kind] = :step
|
16
16
|
dry_result = super
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
case dry_result
|
19
|
+
when Opera::Operation::Result
|
20
|
+
add_instruction_output(instruction, dry_result.to_h)
|
21
|
+
|
22
|
+
unless dry_result.success?
|
23
|
+
result.add_errors(dry_result.errors)
|
24
|
+
result.add_exceptions(dry_result.exceptions)
|
25
|
+
end
|
26
|
+
when Dry::Validation::Result
|
27
|
+
add_instruction_output(instruction, dry_result.to_h)
|
28
|
+
|
29
|
+
result.add_errors(dry_result.errors) unless dry_result.success?
|
30
|
+
else
|
31
|
+
exception_message = "#{dry_result.class} is not expected object. Please check: #{dry_result.inspect}"
|
32
|
+
result.add_exception(instruction[:method], exception_message, classname: operation.class.name)
|
33
|
+
end
|
20
34
|
end
|
21
35
|
end
|
22
36
|
end
|
data/lib/opera/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ProFinda Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-validation
|