Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelSelectState.java @ 7657:84573d5935be
Improved logging.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 05 Dec 2013 22:22:37 +0100 |
parents | 21adafca6441 |
children | a16caa4355be |
comparison
equal
deleted
inserted
replaced
7656:ad5238e3e736 | 7657:84573d5935be |
---|---|
53 | 53 |
54 | 54 |
55 /** | 55 /** |
56 * @param flys ignored | 56 * @param flys ignored |
57 * @param cc ignrored | 57 * @param cc ignrored |
58 * @param stateData ignored | |
58 */ | 59 */ |
59 @Override | 60 @Override |
60 public StateData transform( | 61 public StateData transform( |
61 D4EArtifact flys, | 62 D4EArtifact flys, |
62 CallContext cc, | 63 CallContext cc, |
160 else if (artifact instanceof StaticWKmsArtifact) { | 161 else if (artifact instanceof StaticWKmsArtifact) { |
161 wkms = new WKms[] {((StaticWKmsArtifact) artifact).getWKms(0)}; | 162 wkms = new WKms[] {((StaticWKmsArtifact) artifact).getWKms(0)}; |
162 } | 163 } |
163 else { | 164 else { |
164 if (rawData == null) { | 165 if (rawData == null) { |
165 logger.error("Null data arrived at WaterlevelSelectState."); | 166 logger.error("Do not know how to handle null data " + |
167 "from artifact class " + artifact.getClass()); | |
166 } | 168 } |
167 else { | 169 else { |
168 logger.error("Do not know how to handle " + rawData.getClass()); | 170 logger.error("Do not know how to handle " + rawData.getClass()); |
169 } | 171 } |
170 | 172 |
171 wkms = null; | 173 wkms = null; |
174 if (wqkms == null || wqkms.length == 0) { | |
175 logger.error("No data for label generation."); | |
176 // This is critical, will fail without much grace later further down | |
177 // the road. | |
178 return new String[] {""}; | |
172 } | 179 } |
173 | 180 |
174 int idx = -1; | 181 int idx = -1; |
175 try { | 182 try { |
176 idx = Integer.parseInt(parts[2]); | 183 idx = Integer.parseInt(parts[2]); |
177 if (wkms[idx] == null) { | 184 if (wkms[idx] == null) { |
178 logger.warn("null label for " + value + " (" + parts[2] + ")"); | 185 logger.error("null label for " + value + " (" + parts[2] + ")"); |
179 return new String[] {""}; | 186 return new String[] {""}; |
180 } | 187 } |
181 String name = wkms[idx].getName(); | 188 String name = wkms[idx].getName(); |
182 | 189 |
183 return new String[] { StringUtil.wWrap(name) }; | 190 return new String[] { StringUtil.wWrap(name) }; |