File tree Expand file tree Collapse file tree
ambari-server/src/main/java/org/apache/ambari/server/stack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,10 @@ public ThemeModule(File themeFile, ThemeInfo moduleInfo) {
5858 try {
5959 reader = new FileReader (themeFile );
6060 } catch (FileNotFoundException e ) {
61- LOG .error ("Theme file not found" );
61+ LOG .error ("Theme file not found: {}" , themeFile .getAbsolutePath ());
62+ setValid (false );
63+ addError ("Theme file not found: " + themeFile .getAbsolutePath ());
64+ return ;
6265 }
6366 try {
6467 Theme theme = mapper .readValue (reader , Theme .class );
@@ -70,6 +73,14 @@ public ThemeModule(File themeFile, ThemeInfo moduleInfo) {
7073 LOG .error ("Unable to parse theme file " , e );
7174 setValid (false );
7275 addError ("Unable to parse theme file " + themeFile );
76+ } finally {
77+ if (reader != null ) {
78+ try {
79+ reader .close ();
80+ } catch (IOException e ) {
81+ LOG .warn ("Failed to close theme file reader" , e );
82+ }
83+ }
7384 }
7485 }
7586 }
You can’t perform that action at this time.
0 commit comments