[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [python]afslutte ved exception



Tirsdag den 6. juni 2006 13:12 skrev Atte André Jensen:
> Hejsa
>
> Jeg har et program som ved visse exceptions ikke meningsfyldt kan køre
> videre. Hvordan håndteres det pænest? Kan man fx afslutte al
> programudførsel (efter at have outputtet en passende, undskyldende
> besked til brugeren)?

Hvis det er et interaktivt program, ja.

Dog vil jeg anbefale dig at forsøge at styre det med exceptions. Dvs, f.eks. 
at afslutte på yderste niveau, aldrig midt i koden. (Det kan være umuligt at 
styre, desværre).

>
> Jeg kunne også godt tænke mig et link til en hurtig opsummering af
> exception håndtering generelt, god praksis, og om at skrive sin egen
> exception handler...

Generelt forsøger man at skrive al kode til at håndtere sin del af ansvaret. 
Det er umuligt for visse typer af fejl, men for langt den største del er det 
helt muligt. 

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
'Open Systems' means no fences. And no fences means no use for Gates.
                                                       - Sun Microsystems



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-07-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *