jflow 0.3.4 → 0.3.5

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
  SHA1:
3
- metadata.gz: 788624cf432f825cb38797c8b1ca9a69c0877f50
4
- data.tar.gz: 5a5445c5e36f3e759966d6e0d794985e3fc71164
3
+ metadata.gz: 8d5f7566c4c2619932820abfbe9b8ca2beedfbb5
4
+ data.tar.gz: 4cf09a731fbcdd97b3c94606f4eb5e32ca8d0757
5
5
  SHA512:
6
- metadata.gz: 3514edb1f0438a673a13943dc4aa78421bfaae707c92adcfba1d5dda6ada72318f9e4ab41c5c8ef528be8f46ee163d177d94d8bffb3e900176af9011cfec0db2
7
- data.tar.gz: 39cbc626388bf3bfabf2bf655b316f6852396c6c84c9fc204d7709e7a0dbbb4f74d24e815644cb26ffec7f5915c3fb943d5308d18a5f19ccde5e56e1fa049e45
6
+ metadata.gz: d9b75ea31dcf96348296f069f96d52befc41a3517094a541b254d079b57d76b82ffe22ac3a0704183668acd3ae4da0be1199e6139491da23334c0157f4eb5a5b
7
+ data.tar.gz: ed334c3e1544fdcd088fadf8d236a076d18d33b6889944bbaa24c9b0f86814cb8fe89ae4f8eecc2da60f430f2aa3c3a2ff8ff7bd627548c417e57742c5351df3
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  /.ruby-gemset
11
11
  /.ruby-version
12
+ *.sw?
@@ -1,3 +1,5 @@
1
1
  language: ruby
2
+ sudo: false
3
+ cache: bundler
2
4
  rvm:
3
- - jruby-9.0.4.0
5
+ - jruby-9.0.4.0
@@ -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
- swf_client.respond_activity_task_failed({
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: exception.message,
71
- details: exception.backtrace ? exception.backtrace.join("\n") : "no stacktrace",
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
@@ -1,3 +1,3 @@
1
1
  module JFlow
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
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
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-03-24 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk