jflow 0.3.4 → 0.3.5
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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -1
- data/lib/jflow/activity/task.rb +26 -5
- data/lib/jflow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d5f7566c4c2619932820abfbe9b8ca2beedfbb5
|
4
|
+
data.tar.gz: 4cf09a731fbcdd97b3c94606f4eb5e32ca8d0757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9b75ea31dcf96348296f069f96d52befc41a3517094a541b254d079b57d76b82ffe22ac3a0704183668acd3ae4da0be1199e6139491da23334c0157f4eb5a5b
|
7
|
+
data.tar.gz: ed334c3e1544fdcd088fadf8d236a076d18d33b6889944bbaa24c9b0f86814cb8fe89ae4f8eecc2da60f430f2aa3c3a2ff8ff7bd627548c417e57742c5351df3
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/lib/jflow/activity/task.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module JFlow
|
2
2
|
module Activity
|
3
3
|
class Task
|
4
|
+
# From: http://docs.aws.amazon.com/amazonswf/latest/apireference/API_FailWorkflowExecutionDecisionAttributes.html
|
5
|
+
MAX_DETAILS_SIZE = 32768
|
6
|
+
MAX_REASON_SIZE = 256
|
7
|
+
|
8
|
+
TRUNCATION_IDENTIFIER = '[TRUNCATED]'
|
4
9
|
|
5
10
|
attr_reader :task
|
6
11
|
|
@@ -65,15 +70,31 @@ module JFlow
|
|
65
70
|
|
66
71
|
def failed!(exception)
|
67
72
|
log "Task Failed #{exception.message}"
|
68
|
-
|
73
|
+
|
74
|
+
reason = truncate(exception.message, MAX_REASON_SIZE)
|
75
|
+
details = if exception.backtrace
|
76
|
+
truncate(exception.backtrace.join("\n"), MAX_DETAILS_SIZE)
|
77
|
+
else
|
78
|
+
"no stacktrace"
|
79
|
+
end
|
80
|
+
|
81
|
+
swf_client.respond_activity_task_failed(
|
69
82
|
task_token: token,
|
70
|
-
reason:
|
71
|
-
details:
|
72
|
-
|
83
|
+
reason: reason,
|
84
|
+
details: details
|
85
|
+
)
|
73
86
|
end
|
74
87
|
|
75
88
|
private
|
76
89
|
|
90
|
+
def truncate(message, max_length)
|
91
|
+
return message unless message.length > max_length
|
92
|
+
|
93
|
+
tail_room = max_length - TRUNCATION_IDENTIFIER.length
|
94
|
+
|
95
|
+
"#{message[0, tail_room]}#{TRUNCATION_IDENTIFIER}"
|
96
|
+
end
|
97
|
+
|
77
98
|
def swf_client
|
78
99
|
JFlow.configuration
|
79
100
|
.swf_client
|
@@ -84,4 +105,4 @@ module JFlow
|
|
84
105
|
end
|
85
106
|
end
|
86
107
|
end
|
87
|
-
end
|
108
|
+
end
|
data/lib/jflow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christophe Verbinnen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|