Skip to content

Instantly share code, notes, and snippets.

@xdougx
Created October 22, 2015 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdougx/4b5bff3d9ee83377869f to your computer and use it in GitHub Desktop.
Save xdougx/4b5bff3d9ee83377869f to your computer and use it in GitHub Desktop.
Error in ./boot.cr:12: instantiating 'Importation::Base#import()'
Importation::Base.new(App.new).import
^~~~~~
in ./app/importation/base.cr:31: instantiating 'Importation::Runner#run()'
Importation::Runner.new(self, path).run
^~~
in ./app/importation/runner.cr:15: instantiating 'Array(JSON::Type)#each_with_index()'
@sheet.each_with_index do |hash, index|
^~~~~~~~~~~~~~~
in /usr/local/Cellar/crystal-lang/0.9.0/src/enumerable.cr:191: instantiating 'each()'
each do |elem|
^~~~
in /usr/local/Cellar/crystal-lang/0.9.0/src/array.cr:774: instantiating 'each_index()'
each_index do |i|
^~~~~~~~~~
in /usr/local/Cellar/crystal-lang/0.9.0/src/array.cr:774: instantiating 'each_index()'
each_index do |i|
^~~~~~~~~~
in /usr/local/Cellar/crystal-lang/0.9.0/src/enumerable.cr:191: instantiating 'each()'
each do |elem|
^~~~
in ./app/importation/runner.cr:15: instantiating 'Array(JSON::Type)#each_with_index()'
@sheet.each_with_index do |hash, index|
^~~~~~~~~~~~~~~
in ./app/importation/runner.cr:17: instantiating 'Importation::Validator:Class#validate(Hash(String, JSON::Type), Int32, Hash(String, JSON::Type))'
validator = Importation::Validator.validate(hash, index, @attributes)
^~~~~~~~
in ./app/importation/validator.cr:15: instantiating 'Importation::Validator#build()'
validator.build
^~~~~
in ./app/importation/validator.cr:20: instantiating 'composite_fields()'
composite_fields
^~~~~~~~~~~~~~~~
in ./app/importation/validator.cr:59: instantiating 'build_with_ddd()'
build_with_ddd
^~~~~~~~~~~~~~
in ./app/importation/validator.cr:67: undefined method '[]' for Nil (compile-time type is (Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Type) | Array(JSON::Type)))
@hash["phone_code"] = value[0, 1]
^
================================================================================
Nil trace:
./app/importation/validator.cr:66
value = @hash[attr]
^
/usr/local/Cellar/crystal-lang/0.9.0/src/hash.cr:84
def [](key)
^~
/usr/local/Cellar/crystal-lang/0.9.0/src/hash.cr:85
fetch(key)
^~~~~
/usr/local/Cellar/crystal-lang/0.9.0/src/hash.cr:130
def fetch(key)
^~~~~
/usr/local/Cellar/crystal-lang/0.9.0/src/hash.cr:131
fetch(key) do
^~~~~
/usr/local/Cellar/crystal-lang/0.9.0/src/hash.cr:159
def fetch(key)
^~~~~
/usr/local/Cellar/crystal-lang/0.9.0/src/hash.cr:161
entry ? entry.value : yield key
^~~~~
macro getter (in /usr/local/Cellar/crystal-lang/0.9.0/src/object.cr:208):4
def value
^~~~~
macro getter (in /usr/local/Cellar/crystal-lang/0.9.0/src/object.cr:208):5
@value
^~~~~~
macro setter (in /usr/local/Cellar/crystal-lang/0.9.0/src/object.cr:326):3
def value=(@value)
^
macro setter (in /usr/local/Cellar/crystal-lang/0.9.0/src/object.cr:326):3
def value=(@value)
^~~~~
macro setter (in /usr/local/Cellar/crystal-lang/0.9.0/src/object.cr:326):3
def value=(@value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment