Latest 100 public
snipts » error
showing 1-19 of 19 snipts for error
-
∞ PHP enable error reporting
<?php ini_set('error_reporting', E_ALL); ini_set('display_errors',1); ?>
-
∞ log and report errors?
<?php // These settings will log all errors to // /tmp/php-error.log except notices, repeated errors, and errors reported // from the same source. error_reporting(E_ALL & (~E_NOTICE | ~E_USER_NOTICE)); ini_set('error_log', '/tmp/php-error.log'); ini_set('ignore_repeated_errors', true); ini_set('ignore_repeated_source', true); ini_set('log_errors', true); ?>
-
∞ PHP Error Levels
<?php PHP Error Levels //The error_reporting Directive 1.E_NOTICE/ E_USER_NOTICE This notice indicates a potential error in the script—note my emphasis on potential. Errors of this sort typically mean that something has occurred that may indicate logical errors or omissions, even though it hasn’t caused the PHP interpreter to fail. Examples include accessing undefined variables or array indices. 2.E_WARNING/ E_USER_WARNING A warning indicates a nonfatal error from which PHP has recovered. Warnings are generally reserved for environmental errors, such as the inability of the executing script to access a database or web service, errors that occur while you’re running a third-party extension, and so on. 3.E_ERROR/ E_USER_ERROR These are fatal runtime errors from which PHP was unable to recover; typically, they will be errors that occur on the OS level, such as problems encountered while allocating memory or disk space. Note that E_USER_ERRORs are actually recoverable; when such errors are caught in a custom error handler, the developer can choose whether or not to exit script execution. 4.E_STRICT E_STRICT errors are basically notices, but these are deployed to indicate that code you’ve used may be deprecated, or may not follow best practices as determined by the PHP interpreter. ?>
-
∞ Ruby 1.9.2 Rails 3 error
/home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/object/try.rb:29: [BUG] rb_add_method: unsupported method type (8) ruby 1.9.2dev (2009-07-18 trunk 24186) [x86_64-linux] -- control frame ---------- c:0050 p:---- s:0136 b:0136 l:000135 d:000135 CFUNC :alias_method c:0049 p:0044 s:0131 b:0131 l:000130 d:000130 CLASS /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/li c:0048 p:0009 s:0129 b:0129 l:000128 d:000128 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/li c:0047 p:---- s:0127 b:0127 l:000126 d:000126 FINISH c:0046 p:---- s:0125 b:0125 l:000124 d:000124 CFUNC :require c:0045 p:0023 s:0121 b:0121 l:000120 d:000120 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/li c:0044 p:---- s:0119 b:0119 l:000118 d:000118 FINISH c:0043 p:---- s:0117 b:0117 l:000116 d:000116 CFUNC :require c:0042 p:0011 s:0113 b:0113 l:000112 d:000112 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/li c:0041 p:---- s:0111 b:0111 l:000110 d:000110 FINISH c:0040 p:---- s:0109 b:0109 l:000108 d:000108 CFUNC :require c:0039 p:0011 s:0105 b:0105 l:000104 d:000104 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/li c:0038 p:---- s:0103 b:0103 l:000102 d:000102 FINISH c:0037 p:---- s:0101 b:0101 l:000100 d:000100 CFUNC :require c:0036 p:0035 s:0097 b:0097 l:000096 d:000096 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/li c:0035 p:---- s:0095 b:0095 l:000094 d:000094 FINISH c:0034 p:---- s:0093 b:0093 l:000092 d:000092 CFUNC :require c:0033 p:0023 s:0089 b:0089 l:000088 d:000088 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/li c:0032 p:---- s:0087 b:0087 l:000086 d:000086 FINISH c:0031 p:---- s:0085 b:0085 l:000084 d:000084 CFUNC :require c:0030 p:0076 s:0081 b:0081 l:000080 d:000080 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/a c:0029 p:---- s:0078 b:0078 l:000077 d:000077 FINISH c:0028 p:---- s:0076 b:0076 l:000075 d:000075 CFUNC :require c:0027 p:0011 s:0072 b:0072 l:000071 d:000071 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/a c:0026 p:---- s:0070 b:0070 l:000069 d:000069 FINISH c:0025 p:---- s:0068 b:0068 l:000067 d:000067 CFUNC :require c:0024 p:0023 s:0064 b:0064 l:000063 d:000063 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/a c:0023 p:---- s:0062 b:0062 l:000061 d:000061 FINISH c:0022 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC :require c:0021 p:0047 s:0056 b:0056 l:000055 d:000055 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activerecord/lib c:0020 p:---- s:0054 b:0054 l:000053 d:000053 FINISH c:0019 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC :require c:0018 p:0021 s:0048 b:0048 l:000039 d:000047 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rai c:0017 p:---- s:0045 b:0045 l:000044 d:000044 FINISH c:0016 p:---- s:0043 b:0043 l:000042 d:000042 CFUNC :each c:0015 p:0032 s:0040 b:0040 l:000039 d:000039 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rai c:0014 p:---- s:0038 b:0038 l:000037 d:000037 FINISH c:0013 p:---- s:0036 b:0036 l:000035 d:000035 CFUNC :require c:0012 p:0038 s:0032 b:0032 l:000031 d:000031 TOP /home/loyolny/Aptana Studio 3 Workspace/Communita/config/application.rb:3 c:0011 p:---- s:0030 b:0030 l:000029 d:000029 FINISH c:0010 p:---- s:0028 b:0028 l:000027 d:000027 CFUNC :require c:0009 p:0016 s:0024 b:0024 l:000015 d:000023 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rai c:0008 p:---- s:0021 b:0021 l:000020 d:000020 FINISH c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :tap c:0006 p:0442 s:0016 b:0016 l:000015 d:000015 TOP /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rai c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :require c:0003 p:0097 s:0006 b:0006 l:0021c8 d:002678 EVAL script/rails:9 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:0021c8 d:0021c8 TOP --------------------------- -- Ruby level backtrace information----------------------------------------- script/rails:9:in `<main>' script/rails:9:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:27:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:27:in `tap' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:28:in `block in <top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:28:in `require' /home/loyolny/Aptana Studio 3 Workspace/Communita/config/application.rb:3:in `<top (required)>' /home/loyolny/Aptana Studio 3 Workspace/Communita/config/application.rb:3:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/all.rb:5:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/all.rb:5:in `each' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/all.rb:11:in `block in <top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/all.rb:11:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activerecord/lib/active_record/railtie.rb:9:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activerecord/lib/active_record/railtie.rb:9:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_controller/railtie.rb:2:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_controller/railtie.rb:2:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_controller.rb:1:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_controller.rb:1:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/abstract_controller.rb:4:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/abstract_controller.rb:4:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/ruby/shim.rb:12:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/ruby/shim.rb:12:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/date/calculations.rb:3:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/date/calculations.rb:3:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/time/zones.rb:1:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/time/zones.rb:1:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/time_with_zone.rb:1:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/time_with_zone.rb:1:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/values/time_zone.rb:2:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/values/time_zone.rb:2:in `require' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/object/try.rb:1:in `<top (required)>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/object/try.rb:29:in `<class:Object>' /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/core_ext/object/try.rb:29:in `alias_method' -- C level backtrace information ------------------------------------------- /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_vm_bugreport+0x9f) [0x515a2f] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5514b8] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_bug+0xb1) [0x551671] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_alias+0x102) [0x511722] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x51194a] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_yield+0x228) [0x513ae8] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_ary_each+0x45) [0x523ee5] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_yield+0x228) [0x513ae8] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_obj_tap+0x9) [0x44e3f9] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval+0x1b0) [0x50c550] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5535e4] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_require_safe+0x63f) [0x554dbf] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x5005c2] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x512001] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x507fdb] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x50c02b] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(rb_iseq_eval_main+0x269) [0x50c369] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(ruby_exec_node+0xb2) [0x419a62] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(ruby_run_node+0x37) [0x41b537] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby(main+0x49) [0x418c19] /lib/libc.so.6(__libc_start_main+0xfd) [0x7f4e1ffd4abd] /home/loyolny/.rvm/rubies/ruby-1.9.2-preview1/bin/ruby [0x418b09]
-
∞ Ruby 1.9.2 and Rails Beta 3 error
/home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/values/time_zone.rb:208:in `utc_offset': undefined method `current_period' for nil:NilClass (NoMethodError) from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/values/time_zone.rb:222:in `<=>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/values/time_zone.rb:333:in `sort!' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/values/time_zone.rb:333:in `<class:TimeZone>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/values/time_zone.rb:25:in `<module:ActiveSupport>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/values/time_zone.rb:24:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/time_with_zone.rb:1:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/time_with_zone.rb:1:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/time/zones.rb:1:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/time/zones.rb:1:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/date/calculations.rb:3:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/date/calculations.rb:3:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/ruby/shim.rb:12:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activesupport-3.0.0.beta3/lib/active_support/ruby/shim.rb:12:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/actionpack-3.0.0.beta3/lib/abstract_controller.rb:4:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/actionpack-3.0.0.beta3/lib/abstract_controller.rb:4:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/actionpack-3.0.0.beta3/lib/action_controller.rb:1:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/actionpack-3.0.0.beta3/lib/action_controller.rb:1:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/actionpack-3.0.0.beta3/lib/action_controller/railtie.rb:2:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/actionpack-3.0.0.beta3/lib/action_controller/railtie.rb:2:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activerecord-3.0.0.beta3/lib/active_record/railtie.rb:9:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/activerecord-3.0.0.beta3/lib/active_record/railtie.rb:9:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/railties-3.0.0.beta3/lib/rails/all.rb:11:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/railties-3.0.0.beta3/lib/rails/all.rb:11:in `block in <top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/railties-3.0.0.beta3/lib/rails/all.rb:5:in `each' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/railties-3.0.0.beta3/lib/rails/all.rb:5:in `<top (required)>' from /home/loyolny/Aptana Studio 3 Workspace/Communita/config/application.rb:3:in `require' from /home/loyolny/Aptana Studio 3 Workspace/Communita/config/application.rb:3:in `<top (required)>' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/railties-3.0.0.beta3/lib/rails/commands.rb:39:in `require' from /home/loyolny/.rvm/gems/ruby-1.9.2-preview1/gems/railties-3.0.0.beta3/lib/rails/commands.rb:39:in `<top (required)>' from script/rails:9:in `require' from script/rails:9:in `<main>'
-
∞ Mongrel segmentation fault
/home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/module/delegation.rb:118: [BUG] Segmentation fault ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux] -- control frame ---------- c:0077 p:---- s:0389 b:0389 l:000388 d:000388 CFUNC :caller c:0076 p:0159 s:0386 b:0386 l:000385 d:000385 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta3/lib/active_support/core_ext/module/delegation.rb:118 c:0075 p:0123 s:0377 b:0377 l:000376 d:000376 CLASS /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/relation.rb:12 c:0074 p:0011 s:0375 b:0375 l:000374 d:000374 CLASS /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/relation.rb:4 c:0073 p:0021 s:0373 b:0373 l:000372 d:000372 TOP /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/relation.rb:3 c:0072 p:---- s:0371 b:0371 l:000370 d:000370 FINISH c:0071 p:0022 s:0369 b:0369 l:000368 d:000368 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/base.rb:1027 c:0070 p:0121 s:0366 b:0366 l:000365 d:000365 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/named_scope.rb:30 c:0069 p:0011 s:0360 b:0360 l:000359 d:000359 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/base.rb:403 c:0068 p:0017 s:0355 b:0355 l:000354 d:000354 METHOD /home/loyolny/Aptana Studio 3 Workspace/Communita/app/controllers/marriages_controller.rb:5 c:0067 p:---- s:0352 b:0352 l:000351 d:000351 FINISH c:0066 p:---- s:0350 b:0350 l:000349 d:000349 CFUNC :send c:0065 p:0012 s:0346 b:0346 l:000345 d:000345 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal/implicit_render.rb:4 c:0064 p:0015 s:0341 b:0341 l:000340 d:000340 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/abstract_controller/base.rb:153 c:0063 p:0041 s:0336 b:0336 l:000335 d:000335 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal/rendering.rb:11 c:0062 p:0012 s:0332 b:0332 l:002340 d:000331 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal/instrumentation.rb:29 c:0061 p:0039 s:0328 b:0328 l:000327 d:000327 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta3/lib/active_support/notifications/instrumenter.rb:18 c:0060 p:0023 s:0321 b:0321 l:000320 d:000320 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta3/lib/active_support/notifications.rb:48 c:0059 p:0152 s:0316 b:0316 l:002340 d:002340 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal/instrumentation.rb:28 c:0058 p:0010 s:0310 b:0310 l:000b40 d:000309 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/abstract_controller/callbacks.rb:18 c:0057 p:0063 s:0308 b:0308 l:000307 d:000307 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:433 c:0056 p:0168 s:0302 b:0302 l:000301 d:000301 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:404 c:0055 p:0024 s:0293 b:0293 l:000292 d:000292 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88 c:0054 p:0015 s:0287 b:0287 l:000b40 d:000b40 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/abstract_controller/callbacks.rb:17 c:0053 p:0012 s:0283 b:0283 l:000282 d:000282 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal/rescue.rb:8 c:0052 p:0077 s:0278 b:0278 l:000277 d:000277 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/abstract_controller/base.rb:123 c:0051 p:0084 s:0272 b:0272 l:000271 d:000271 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/abstract_controller/rendering.rb:39 c:0050 p:0045 s:0267 b:0267 l:000266 d:000266 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal.rb:84 c:0049 p:0046 s:0262 b:0262 l:000261 d:000261 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal/rack_delegation.rb:14 c:0048 p:0030 s:0257 b:0257 l:001d28 d:000256 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_controller/metal.rb:124 c:0047 p:---- s:0254 b:0254 l:000253 d:000253 FINISH c:0046 p:---- s:0252 b:0252 l:000251 d:000251 CFUNC :call c:0045 p:0096 s:0248 b:0248 l:000247 d:000247 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/routing/route_set.rb:29 c:0044 p:0095 s:0242 b:0242 l:000214 d:000241 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/rack-mount-0.6.3/lib/rack/mount/route_set.rb:148 c:0043 p:0014 s:0236 b:0236 l:000220 d:000235 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/rack-mount-0.6.3/lib/rack/mount/code_generation.rb:89 c:0042 p:1772 s:0231 b:0231 l:000230 d:000230 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/rack-mount-0.6.3/lib/rack/mount/code_generation.rb:115 c:0041 p:0193 s:0221 b:0221 l:000220 d:000220 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/rack-mount-0.6.3/lib/rack/mount/code_generation.rb:88 c:0040 p:0089 s:0215 b:0215 l:000214 d:000214 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/rack-mount-0.6.3/lib/rack/mount/route_set.rb:139 c:0039 p:0024 s:0209 b:0209 l:000208 d:000208 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/routing/route_set.rb:458 c:0038 p:0013 s:0205 b:0205 l:000a40 d:000204 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/query_cache.rb:31 c:0037 p:0017 s:0203 b:0203 l:000202 d:000202 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/connection_adapters/abstract/query_cach c:0036 p:0051 s:0199 b:0199 l:000198 d:000198 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/query_cache.rb:11 c:0035 p:0019 s:0195 b:0195 l:000a40 d:000a40 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/query_cache.rb:30 c:0034 p:0014 s:0191 b:0191 l:000190 d:000190 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/activerecord-3.0.0.beta3/lib/active_record/connection_adapters/abstract/connection c:0033 p:0090 s:0187 b:0187 l:000186 d:000186 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/head.rb:14 c:0032 p:0150 s:0180 b:0180 l:000179 d:000179 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/methodoverride.rb:24 c:0031 p:0045 s:0174 b:0174 l:000173 d:000173 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/params_parser.rb:19 c:0030 p:0051 s:0169 b:0169 l:000168 d:000168 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/flash.rb:167 c:0029 p:0086 s:0163 b:0163 l:000162 d:000162 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/session/cookie_store.rb:107 c:0028 p:0014 s:0153 b:0153 l:000152 d:000152 METHOD /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/cookies.rb:202 c:0027 p:0029 s:0144 b:0144 l:000e60 d:000143 BLOCK /home/loyolny/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/callbacks.rb:46 Segmentation fault
-
∞ getting rid of foreach error
<?php // double any value whose key starts with 'b' $arr = array('a'=>1, 'b1'=>2, 'b2'=>3, 'c'=>4, 'd'=>5); $non_array = null; // Normal usage with an array print "Test 1:\n"; foreach ($arr as $key => $val) { print "Key $key, Value $val\n"; } // Normal usage with a non-array (undefined or otherwise empty data set) // Outputs: Warning: Invalid argument supplied for foreach() in test.php on line 16 print "Test 2:\n"; foreach ($non_array as $key => $val) { print "Key $key, Value $val\n"; } // By casting the $non_array to an (array) type, it will function without error, skipping the loop print "Test 3:\n"; foreach ((array) $non_array as $key => $val) { print "Key $key, Value $val\n"; } print "Done.\n"; ?>
-
∞ Log errors in diffent folders/files reflecting the application folder structure.
<?php /** * Log PHP's error into separate files. Recommended for use in production site. * Should be used in set_error_handler() to handle certain PHP errors (i.e. E_STRICT). * @link http://www.php.net/manual/en/function.set-error-handler.php Reference */ function errorHandler($errno, $errstr, $errfile=NULL, $errline=NULL, $errcontext=NULL) { // Log uncategorized errors if (is_null($errfile)) { $errfile = 'errors.log'; } // Reconstruct the path // define('APP_DIR', '/my/application/') // define('LOG_DIR', '/log_dir/') // E.g. /my/application/controller/index.php -> /log_dir/controller/index.php $pos = strpos($errfile, APP_DIR); if ($pos !== FALSE) { // Strip off the application directory and attach log directory $errfile = LOG_DIR.substr($errfile, $pos + strlen(CMS_ROOT)); } else { $errfile = LOG_DIR.$errfile; // E.g. /log_dir/errors.log } $dir = dirname($errfile); // Create dir if necessary if (! file_exists($dir)) { mkdir($dir, 0775, TRUE); } $logFile = fopen($errfile, 'a'); fwrite($logFile, date('Y-m-d H:i:s ').$errstr); if ($errline) fwrite($logFile, " on line $errline"); fwrite($logFile, "\n"); fclose($logFile); if (PRODUCTION_SITE) // Prevent err msg from being printed out (log errors silently) return TRUE; return FALSE; } ?>
-
∞ htacccess php error reporting
#php_flag display_errors on #php_value error_reporting 2048
-
∞ Log file error histogram analysis
#!/usr/bin/python # Useful spotting patterns in errors logged to files. Intended to be used # on rolled log files where the filename contains the date or some other # unique index or sequence. # # Example: # foo-2009-04-23.log # foo-2009-04-24.log # foo-2009-04-25.log # # Use grep to generate the input for this script. Use a pattern which will # match a variety of possible events. This works best when only one such # event is reported per line. # # Use the '-o' flag to output only the matched section: # # > grep -o "\b\w*Exception\b" * # # foo-2009-04-23.log:RuntimeException # foo-2009-04-23.log:IOException # foo-2009-04-23.log:IOException # foo-2009-04-23.log:IOException # foo-2009-04-24.log:FileNotFoundException # foo-2009-04-24.log:IOException # foo-2009-04-25.log:OutOfMemoryException # # Pipe this output to this script and you will get cross-referenced # histograms of: # # By input file (date): # Count for each error type # # By Error type: # Count for each day of ocurrence # # Number of errors (per file/date) - descending order # # Number of errors (per error type) - descending order import sys from math import log date_exception = dict() exception_date = dict() exception_all = dict() date_all = dict() def splitlines(): input = sys.stdin.readlines() for line in input: (date, exception) = line.strip().split(":") if (not date_all.has_key(date)): date_all[date] = 0 date_all[date] += 1 if (not exception_all.has_key(exception)): exception_all[exception] = 0 exception_all[exception] += 1 if (not date_exception.has_key(date)): date_exception[date] = dict() count_map = date_exception[date] if (not count_map.has_key(exception)): count_map[exception] = 0 count_map[exception] += 1 if (not exception_date.has_key(exception)): exception_date[exception] = dict() count_map = exception_date[exception] if (not count_map.has_key(date)): count_map[date] = 0 count_map[date] += 1 def print_bar(prefix, label, value): print prefix + "%-30s (%5d) %s" % (label, value, "#" * int(log(value+1)*3)) if __name__ == '__main__': splitlines() print "\n" for k in date_exception.keys(): d = date_exception[k] print k l = sorted(d.iteritems(), key=lambda (k,v): (v,k), reverse=True) for item in l: print_bar(" ", item[0], item[1]) print "\n" for k in exception_date.keys(): d = exception_date[k] print k l = sorted(d.iteritems(), key=lambda (k,v): (v,k), reverse=True) for item in l: print_bar(" ", item[0], item[1]) print "\n" for s in sorted(exception_all.iteritems(), key=lambda (k,v): (v,k), reverse=True): print_bar("", s[0], s[1]) print "\n" for s in sorted(date_all.iteritems(), key=lambda (k,v): (v,k), reverse=True): print_bar("", s[0], s[1])
-
∞ php error checking
<? // ============== // error checking // ============== if ($xmlFile === false) die('1'); // max char length if (isset($xmlFile{201})) die('File name too long'); // regex check for chars, numbers, periods, dash, and underscores only // also make sure there isn't 2 or more period next to each other. if (preg_match("/[^A-Za-z0-9_.\-]/", $xmlFile) || preg_match("/[.]{2,}/", $xmlFile)) die('2'); // check if extension is xml if (!preg_match("/[.]xml$/", $xmlFile)) die('3'); // check if file exist if (!file_exists($_SERVER['DOCUMENT_ROOT']."/blah/$xmlFile")) die('File does not exist.');
-
∞ Forzar errores
<?php ini_set ("display_errors","1" ) ?>
-
∞ Simple CSS error messages with as little html markup as possible.
<!-- Use as shown below. Assumes the use of any 16x16 icons. Larger or smaller may have to adjust line-height and padding. Markup is half the size of my old version, which used nested tags to dictate padding necessary for bg images. Feel free to remove redundant selectors. They are present to ensure this will work stand-alone. --> <style type="text/css"> .error, .confirm { font: normal normal 300 13px/16px Arial, Helvetica, sans-serif; margin: 10px 0; padding: 5px; text-indent: 25px; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } .error { background: #FEF1EC url(../assets/images/exclamation_frame.png) no-repeat 8px 5px; border: 1px solid #CD0A0A; color: #CD0A0A; } .confirm { background: #D8FFD3 url(../assets/images/tick_circle_frame.png) no-repeat 8px 5px; border: 1px solid #337C2A; color: #337C2A; } </style> <p class="error">Some error!</p> <p class="confirm">Some confirmation!</p>
-
∞ Ultimate Error Reporting For GCC
-Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align \ -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations \ -Wredundant-decls -Wnested-externs -Winline -Wno-long-long \ -Wconversion -Wstrict-prototypes
-
∞ Disable Error Reporting
<?php error_reporting(0); ?>
-
∞ zope3 application system error
A system error has occurred.
-
∞ Simple Clearing of floats
<div id="outer"> <div id="inner"> <h2>A Column</h2> </div> <h1>Main Content</h1> <p>Lorem ipsum</p> </div> #inner{ width:26%; float:left; } #outer{ width:100%; overflow:auto }
-
∞ ERROR: x11-plugins/compiz-plugins-freewins-9999 failed.
>>> Verifying ebuild manifests >>> Emerging (1 of 1) x11-plugins/compiz-plugins-freewins-9999 from desktop-effects * checking ebuild checksums ;-) ... [ ok ] * checking auxfile checksums ;-) ... [ ok ] * checking miscfile checksums ;-) ... [ ok ] >>> Unpacking source... * git update start --> * repository: git://anongit.compiz-fusion.org/users/warlock/freewins * local clone: /usr/portage/distfiles/git-src/compiz-plugins-freewins * committish: master >>> Unpacked to /var/tmp/portage/x11-plugins/compiz-plugins-freewins-9999/work/freewins >>> Source unpacked in /var/tmp/portage/x11-plugins/compiz-plugins-freewins-9999/work >>> Compiling source in /var/tmp/portage/x11-plugins/compiz-plugins-freewins-9999/work/freewins ... make -s -j3 convert : freewins.xml.in -> build/freewins.xml bcop'ing : build/freewins.xml -> build/freewins_options.hbcop'ing : build/freewins.xml -> build/freewins_options.h bcop'ing : build/freewins.xml -> build/freewins_options.cc -> build/action.lo compiling : freewins.c -> build/freewins.lolibtool: compile: unable to infer tagged configuration libtool: compile: specify a tag with `--tag' make: *** [build/events.lo] Fehler 1 make: *** Warte auf noch nicht beendete Prozesse... libtool: compile: unable to infer tagged configuration libtool: compile: specify a tag with `--tag' make: *** [build/action.lo] Fehler 1 libtool: compile: unable to infer tagged configuration libtool: compile: specify a tag with `--tag' make: *** [build/freewins.lo] Fehler 1 * * ERROR: x11-plugins/compiz-plugins-freewins-9999 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 2555: Called die * The specific snippet of code: * emake || die "emake failed" * The die message: * emake failed * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/lib/entropy/logs/x11-plugins:compiz-plugins-freewins-9999:20090128-204924.log'. * The ebuild environment file is located at '/var/tmp/portage/x11-plugins/compiz-plugins-freewins-9999/temp/environment'. * This ebuild is from an overlay named 'desktop-effects': '/usr/local/portage/layman/desktop-effects/' * >>> Failed to emerge x11-plugins/compiz-plugins-freewins-9999, Log file: >>> '/var/lib/entropy/logs/x11-plugins:compiz-plugins-freewins-9999:20090128-204924.log'
-
∞ Php debug
<?php $debug = true;// false for live website $contact_email = ""; # **************************** # # ***** ERROR MANAGEMENT ***** # // Create the error handler. function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) { global $debug, $contact_email; // Build the error message. $message = "An error occurred in script '$e_file' on line $e_line: \n<br />$e_message\n<br />"; // Add the date and time. $message .= "Date/Time: " . date('n-j-Y H:i:s') . "\n<br />"; // Append $e_vars to the $message. $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n<br />"; if ($debug) { // Show the error. echo '<p class="error">' . $message . '</p>'; } else { // Log the error: error_log ($message, 1, $contact_email); // Send email. // Only print an error message if the error isn't a notice or strict. if ( ($e_number != E_NOTICE) && ($e_number < 2048)) { echo '<p class="error">A system error occurred. We apologize for the inconvenience.</p>'; } } // End of $debug IF. } // End of my_error_handler() definition. // Use my error handler: set_error_handler ('my_error_handler'); ?>


