Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [symfony] obsługa wyjątków
Papub
post
Post #1





Grupa: Zarejestrowani
Postów: 113
Pomógł: 1
Dołączył: 17.02.2006

Ostrzeżenie: (0%)
-----


witam, mam klasę
  1. class galeria_foldery {
  2. private $url;
  3. public function __construct($foldergalerii) {
  4. if(is_dir($foldergalerii)) {
  5. $this->url = $foldergalerii;
  6. } else {
  7. throw new Exception("Brak folderu galerii");
  8. }
  9. }
  10. }
  11.  
  12.  
  13. class galerieActions extends sfActions
  14. {
  15. try {
  16. $galeriafoldery = new galeria_foldery('galeriana');
  17. } catch(Exception $e) {
  18. $response['error'] = $e->getMessage();
  19. $this->status = json_encode($response);
  20. }
  21. }


Tworząc obiekt klasy galeria_foldery zgłasza wyjątek tak jak powinno być. Jednak $e-getMessage() zwraca mi null zamiast komunikatu błedu. Coś robię nie tak?

Ten post edytował Papub 22.04.2012, 17:18:19
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 18:18