堆栈级别太深。函数<systemstackerror>

时间:2019-03-21 17:23:31

标签: ruby

我有以下方法可以在标题中抛出错误。我知道如果方法是递归的,那就意味着它调用了它的lelef。但是我的方法并没有被自己调用。有人知道我为什么收到此错误吗?

  def self.send_my_message
      sqs = Aws::SQS::Client.new(region: 'us-east-2')
      queue_name = "something"
      queue_url = sqs.get_queue_url(queue_name: queue_name).queue_url
      sqs.send_message(queue_url: queue_url, message_body: 'Hello world')
  end

完整堆栈跟踪错误:

    Response:
{
  "errorMessage": "stack level too deep",
  "errorType": "Function<SystemStackError>",
  "stackTrace": [
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `initialize_dup'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `dup'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:134:in `as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `block in as_json'",
    "/opt/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/core_ext/object/json.rb:152:in `map'"
  ]
}

0 个答案:

没有答案