Commit 66d4c3fd20bf7843030820a44c06635156a109bc

Authored by AndrewVolosytnykhThingsboard
Committed by GitHub
1 parent 854307fd

Clean exception message without class name and path (#4758)

* Clean exception message without class name and path

* Correct message, improvents to text of poppup on deleting

* Added log for except files

* Correct license header
... ... @@ -86,7 +86,10 @@ public class DefaultTbResourceService implements TbResourceService {
86 86 } else {
87 87 throw new DataValidationException(String.format("Could not parse the XML of objectModel with name %s", resource.getSearchText()));
88 88 }
89   - } catch (InvalidDDFFileException | IOException e) {
  89 + } catch (InvalidDDFFileException e) {
  90 + log.error("Failed to parse file {}", resource.getFileName(), e);
  91 + throw new DataValidationException("Failed to parse file " + resource.getFileName());
  92 + } catch (IOException e) {
90 93 throw new ThingsboardException(e, ThingsboardErrorCode.GENERAL);
91 94 }
92 95 if (resource.getResourceType().equals(ResourceType.LWM2M_MODEL) && toLwM2mObject(resource, true) == null) {
... ... @@ -194,8 +197,7 @@ public class DefaultTbResourceService implements TbResourceService {
194 197 if (isSave) {
195 198 LwM2mResourceObserve lwM2MResourceObserve = new LwM2mResourceObserve(k, v.name, false, false, false);
196 199 resources.add(lwM2MResourceObserve);
197   - }
198   - else if (v.operations.isReadable()) {
  200 + } else if (v.operations.isReadable()) {
199 201 LwM2mResourceObserve lwM2MResourceObserve = new LwM2mResourceObserve(k, v.name, false, false, false);
200 202 resources.add(lwM2MResourceObserve);
201 203 }
... ... @@ -204,8 +206,7 @@ public class DefaultTbResourceService implements TbResourceService {
204 206 instance.setResources(resources.toArray(LwM2mResourceObserve[]::new));
205 207 lwM2mObject.setInstances(new LwM2mInstance[]{instance});
206 208 return lwM2mObject;
207   - }
208   - else {
  209 + } else {
209 210 return null;
210 211 }
211 212 }
... ...
... ... @@ -2362,7 +2362,7 @@
2362 2362 "delete-resource-text": "Be careful, after the confirmation the resource will become unrecoverable.",
2363 2363 "delete-resource-title": "Are you sure you want to delete the resource '{{resourceTitle}}'?",
2364 2364 "delete-resources-action-title": "Delete { count, plural, 1 {1 resource} other {# resources} }",
2365   - "delete-resources-text": "Be careful, after the confirmation all selected resources will be removed.",
  2365 + "delete-resources-text": "Please note that the selected resources, even if they are used in device profiles, will be deleted.",
2366 2366 "delete-resources-title": "Are you sure you want to delete { count, plural, 1 {1 resource} other {# resources} }?",
2367 2367 "download": "Download resource",
2368 2368 "drop-file": "Drop a resource file or click to select a file to upload.",
... ...