Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error when nonhierarchical rel can't be looked up due to wrong documenttype #28

Open
kspurgin opened this issue Feb 8, 2023 · 0 comments

Comments

@kspurgin
Copy link
Collaborator

kspurgin commented Feb 8, 2023

For example, I created by NHR ingest csv with objectexits instead of the correct objectexit, and got this mess, instead of anything relevant to how to actually fix the problem:

❯  thor batch map nhr
Success: CSID cache cleared
Success: REFNAME cache cleared
Analyzing nonhierarchicalrelationship source CSV for record types to csid-cache...
DEBUGGER: Attaching after process 26345 fork to child process 26365
Elapsed time: 0.06114
/Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/csid_cache_dependency_identifier.rb:62:in `sort': comparison of String with nil failed (ArgumentError)
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/csid_cache_dependency_identifier.rb:62:in `analyze_nonhierarchicalrelationship'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `block in analyze_nonhierarchicalrelationship'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do/mixin.rb:40:in `call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `analyze_nonhierarchicalrelationship'
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/csid_cache_dependency_identifier.rb:33:in `call'
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/csid_cache_dependency_identifier.rb:14:in `call'
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/autocache_runner.rb:24:in `call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `block in call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do/mixin.rb:40:in `call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `call'
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/autocache_runner.rb:12:in `call'
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/map_runner.rb:35:in `call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `block in call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do/mixin.rb:40:in `call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `call'
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch/map_runner.rb:15:in `call'
	from /Users/kristina/code/cs/migration_tools/lib/collectionspace_migration_tools/batch.rb:36:in `map'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `block in map'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do/mixin.rb:40:in `call'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/dry-monads-1.5.0/lib/dry/monads/do.rb:131:in `map'
	from /Users/kristina/code/cs/migration_tools/lib/tasks/batch.thor:68:in `map'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-hollaback-0.2.1/lib/thor/hollaback.rb:68:in `run'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/runner.rb:43:in `method_missing'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:29:in `run'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:135:in `run'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	from /Users/kristina/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/thor-1.2.1/bin/thor:6:in `<top (required)>'
	from /Users/kristina/.rbenv/versions/3.1.0/bin/thor:25:in `load'
	from /Users/kristina/.rbenv/versions/3.1.0/bin/thor:25:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant