Skip to content

Conversation

@schneems
Copy link
Collaborator

When a NoMethodError is raised in a non-production environment, instead of producing:

scratch.rb:7:in `call': undefined method `upcase' for nil:NilClass (NoMethodError)

Ruby programs with dead_end required will produce:

scratch.rb:7:in `call': undefined method `upcase' for nil:NilClass (NoMethodError)


  1  class Pet
  6    def call
❯ 7      puts "Come here #{@neam.upcase}"
  8    end
  9  end

This behavior is disabled in "production" environments as it requires reading from disk and parsing. The main behavior of DeadEnd is reasonably production safe as syntax errors stop a program from executing further and are limited to the number of files on disk. A NoMethodError in production is likely to be hit repeatedly.

@schneems schneems force-pushed the schneems/no-method-error branch from 4c07099 to 3d28b97 Compare December 29, 2020 16:46
When a NoMethodError is raised in a non-production environment, instead of producing:

```
scratch.rb:7:in `call': undefined method `upcase' for nil:NilClass (NoMethodError)
```

Ruby programs with `dead_end` required will produce:

```
scratch.rb:7:in `call': undefined method `upcase' for nil:NilClass (NoMethodError)


  1  class Pet
  6    def call
❯ 7      puts "Come here #{@neam.upcase}"
  8    end
  9  end

```

This behavior is disabled in "production" environments as it requires reading from disk and parsing. The main behavior of DeadEnd is reasonably production safe as syntax errors stop a program from executing further and are limited to the number of files on disk. A NoMethodError in production is likely to be hit repeatedly.
@schneems schneems force-pushed the schneems/no-method-error branch from 3d28b97 to dd8edf7 Compare December 29, 2020 16:56
@schneems schneems merged commit c7f6747 into main Dec 29, 2020
@schneems schneems deleted the schneems/no-method-error branch December 29, 2020 16:58
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

Successfully merging this pull request may close these issues.

2 participants