librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1726] catch the exception from the Artist constructor


From: Clint Adams
Subject: [Librefm-commits] [1726] catch the exception from the Artist constructor
Date: Thu, 21 May 2009 02:03:19 +0000

Revision: 1726
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1726
Author:   clint
Date:     2009-05-21 02:03:18 +0000 (Thu, 21 May 2009)
Log Message:
-----------
catch the exception from the Artist constructor

Modified Paths:
--------------
    trunk/nixtape/artist.php

Modified: trunk/nixtape/artist.php
===================================================================
--- trunk/nixtape/artist.php    2009-05-21 01:50:49 UTC (rev 1725)
+++ trunk/nixtape/artist.php    2009-05-21 02:03:18 UTC (rev 1726)
@@ -26,7 +26,13 @@
 require_once('data/Server.php');
 require_once('data/TagCloud.php');
 
-$artist = new Artist($_GET['artist']);
+try {
+       $artist = new Artist($_GET['artist']);
+} catch (exception $e) {
+        $smarty->assign('error', 'Artist not found.');
+        $smarty->assign('details', 'The artist '.($artist).' was not found in 
the database.');
+       $smarty->display("error.tpl");
+}
 
 $smarty->assign('name', $artist->name);
 $smarty->assign('id', $artist->id);
@@ -53,5 +59,4 @@
 
 $smarty->display("artist.tpl");
 
-
 ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]