lib/plugins/plugins.rb in rsence-2.0.8.19 vs lib/plugins/plugins.rb in rsence-2.0.9.20.pre
- old
+ new
@@ -134,14 +134,25 @@
else
warn "Known const missing: #{name.inspect}"
super
end
end
- plugin_src = params[:src]
- unless RUBY_VERSION.to_f >= 1.9
- plugin_src = "_bundle_path = #{params[:bundle_path].inspect};" + plugin_src
+ begin
+ plugin_src = params[:src]
+ unless RUBY_VERSION.to_f >= 1.9
+ plugin_src = "_bundle_path = #{params[:bundle_path].inspect};" + plugin_src
+ end
+ m.module_eval( plugin_src )
+ rescue => e
+ src_path = params[:src_path]
+ src_path = "<undefined src_path>" if src_path == nil
+ params[:plugin_manager].plugin_error(
+ e,
+ 'BundleLoaderEvalError',
+ "An error occurred while evaluating the plugin bundle #{params[:bundle_name]}.",
+ src_path
+ )
end
- m.module_eval( plugin_src )
end
return mod
rescue => e
src_path = params[:src_path]
src_path = "<undefined src_path>" if src_path == nil