/*
 * Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
 *
 * This file is part of iotagent-lwm2m
 *
 * iotagent-lwm2m is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the License,
 * or (at your option) any later version.
 *
 * iotagent-lwm2m is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with iotagent-lwm2m.
 * If not, seehttp://www.gnu.org/licenses/.
 *
 * For those usages not covered by the GNU Affero General Public License
 * please contact with::daniel.moranjimenez@telefonica.com
 */

module.exports = {
    UnknownInternalError(msg) {
        this.name = 'UNKNOWN_INTERNAL_ERROR';
        this.message = 'Unknown, unespecified internal error: ' + msg;
    },
    OmaRegistryConnectionError(msg) {
        this.name = 'OMA_REGISTRY_CONNECTION_ERROR';
        this.message = "Couldn't retrieve OMA Registry information due to a connection error: " + msg;
    },
    OmaRegistryServerError(status) {
        this.name = 'OMA_REGISTRY_SERVER_ERROR';
        this.message = 'Server error retrieving OMA Registry. Status code: ' + status;
    },
    TypeNotFound() {
        this.name = 'TYPE_NOT_FOUND';
        this.message = 'It was not possible to determine the type for the registering client';
    },
    OmaMappingNotFound() {
        this.name = 'OMA_MAPPING_NOT_FOUND';
        this.message = 'No OMA to NGSI Mapping found for this device or type';
    }
};

@@ -919,49 +919,50 @@
 */%0A%0A
-module.exports = %7B%0A    UnknownInternalErr
+class UnknownInternalError %7B%0A    construct
 or(m
@@ -1081,37 +1081,40 @@
 : ' + msg;%0A    %7D
-,%0A   
+%0A%7D%0Aclass
  OmaRegistryConn
@@ -1124,16 +1124,34 @@
 ionError
+ %7B%0A    constructor
 (msg) %7B%0A
@@ -1307,29 +1307,32 @@
 + msg;%0A    %7D
-,%0A   
+%0A%7D%0Aclass
  OmaRegistry
@@ -1342,16 +1342,34 @@
 verError
+ %7B%0A    constructor
 (status)
@@ -1512,21 +1512,24 @@
 s;%0A    %7D
-,%0A   
+%0A%7D%0Aclass
  TypeNot
@@ -1525,32 +1525,50 @@
 ass TypeNotFound
+ %7B%0A    constructor
 () %7B%0A        thi
@@ -1698,13 +1698,16 @@
    %7D
-,%0A   
+%0A%7D%0Aclass
  Oma
@@ -1721,16 +1721,34 @@
 NotFound
+ %7B%0A    constructor
 () %7B%0A   
@@ -1868,17 +1868,166 @@
  type';%0A
-
     %7D%0A
+%7D%0A%0Amodule.exports = %7B%0A    UnknownInternalError,%0A    OmaRegistryConnectionError,%0A    OmaRegistryServerError,%0A    TypeNotFound,%0A    OmaMappingNotFound%0A
 %7D;%0A

Add constructors