Re: Exception werfen (Controller und Webservice)
[email protected] Tue, 20 Feb 2007 10:10:10 -0500 (EST)
| Newsgroups | gmane.comp.lang.ruby.german |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
---2049402039-1495686117-1171984210=:1692
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
Hi --
On Tue, 20 Feb 2007, Nils Beckmann wrote:
> Hi,
>
> ich hab ein kleines Problem, bzw wei=DF keine L=F6sung auf eine Aufgabe d=
ie ein
> Programm, Ruby on Rails, erf=FCllen soll. Ich m=F6chte das eine Exception=
in
> einer Methode geworfen wird. Die Methode wird von einem anderen Controlle=
r
> genutzt. Sieht schematisch wie folgt aus.
>
> <class AController < ApplicationController
> <def arbeite
> < begin
> < BController.new().werfe
> < rescue
> < #geb Fehlermeldung aus
> < end
> <end
> <
> <class BController < ApplicationController
> <def werfe
> < raise " Fehlermeldung"
> <end
>
>
> Dabei wird die Methode arbeite auch von einem WebServcie genutzt. Dort so=
ll
> die Fehlermeldung auch zur=FCck gegeben werden.
> Hab da leider keine Idee.
Im Allgemeinen ist es viel besser, wenn Methoden, die von mehreren
Controllers genutzt werden, in Application.rb stecken. Ob dass in
diesem Falle moeglich waere?
David
--=20
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)
---2049402039-1495686117-1171984210=:1692
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Ruby-de-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ruby-de-talk
---2049402039-1495686117-1171984210=:1692--