Docunext


NoMethodError undefined method bytesize for ...

December 5th, 2009

I'm trying to use a custom error page in Sinatra, but I'm getting this error:

NoMethodError: undefined method `bytesize' for [:name, ["Name is already taken"]]:Array

If I try to create a custom error like this:

error MyCustomError do
  'So what happened was...' + request.env['sinatra.error'].message
end

I get this page:

./regdel.rb:70: uninitialized constant MyCustomError (NameError)

Hmmmm.

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020