comparison src/java/de/intevation/mxd/Converter.java @ 255:5c80058c08f6

Replaced error outputs with logging messages.
author raimund renkert <raimund.renkert@intevation.de>
date Mon, 15 Aug 2011 14:12:19 +0200
parents df4e0946ef02
children 10e0aa283217
comparison
equal deleted inserted replaced
254:8e5d67c45b64 255:5c80058c08f6
98 if(mxdfile == null) { 98 if(mxdfile == null) {
99 try { 99 try {
100 mxdfile = readProperty("mxd"); 100 mxdfile = readProperty("mxd");
101 } 101 }
102 catch(Exception e) { 102 catch(Exception e) {
103 e.printStackTrace (); 103 logger.warn(
104 "No property file found. " +
105 "Please provide a valid property file or append " +
106 "parameters for mxd file, map file and template.");
104 } 107 }
105 } 108 }
106 if(mapfile == null) { 109 if(mapfile == null) {
107 try { 110 try {
108 mapfile = readProperty("map"); 111 mapfile = readProperty("map");
109 } 112 }
110 catch(Exception e) { 113 catch(Exception e) {
111 e.printStackTrace (); 114 logger.warn(
115 "No property file found. " +
116 "Please provide a valid property file or append " +
117 "parameters for mxd file, map file and template.");
112 } 118 }
113 } 119 }
114 if(maptemplate == null) { 120 if(maptemplate == null) {
115 try { 121 try {
116 maptemplate = readProperty("map-template"); 122 maptemplate = readProperty("map-template");
117 } 123 }
118 catch(Exception e) { 124 catch(Exception e) {
119 e.printStackTrace (); 125 logger.warn(
126 "No property file found. " +
127 "Please provide a valid property file or append " +
128 "parameters for mxd file, map file and template.");
120 } 129 }
121 } 130 }
122 131
123 IReader reader = new MXDReader(); 132 IReader reader = new MXDReader();
124 IWriter writer = new MapScriptWriter(maptemplate, mapfile); 133 IWriter writer = new MapScriptWriter(maptemplate, mapfile);
129 138
130 writer.write(reader.getMapDocument()); 139 writer.write(reader.getMapDocument());
131 reader.shutdown(); 140 reader.shutdown();
132 } 141 }
133 catch(Exception e) { 142 catch(Exception e) {
134 logger.error(e.getMessage()); 143 logger.debug(e.getMessage());
135 e.printStackTrace(); 144 logger.error(
145 "General error." +
146 " See logging file for more information.");
136 } 147 }
137 } 148 }
138 149
139 private static String readProperty (String key) 150 private static String readProperty (String key)
140 throws Exception { 151 throws Exception {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)