IGNITE-3262 Refactored error names.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/020c96a6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/020c96a6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/020c96a6 Branch: refs/heads/ignite-3262 Commit: 020c96a665075f2e3ab424d987067d76f60623c0 Parents: 573b5a6 Author: Maxim Afanasiev <[email protected]> Authored: Thu Jun 30 10:25:03 2016 +0700 Committer: Maxim Afanasiev <[email protected]> Committed: Thu Jun 30 10:25:03 2016 +0700 ---------------------------------------------------------------------- .../src/main/js/serve/errors/AppError.js | 35 ------------------- .../main/js/serve/errors/AppErrorException.js | 36 ++++++++++++++++++++ .../js/serve/errors/DuplicateKeyException.js | 4 +-- .../src/main/js/serve/errors/ServerError.js | 31 ----------------- .../js/serve/errors/ServerErrorException.js | 36 ++++++++++++++++++++ .../src/main/js/serve/errors/index.js | 6 ++-- 6 files changed, 77 insertions(+), 71 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/020c96a6/modules/web-console/src/main/js/serve/errors/AppError.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/errors/AppError.js b/modules/web-console/src/main/js/serve/errors/AppError.js deleted file mode 100644 index 74f5e9e..0000000 --- a/modules/web-console/src/main/js/serve/errors/AppError.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -class AppError extends Error { - constructor(message) { - super(message); - this.name = this.constructor.name; - this.code = 400; - this.httpCode = 400; - this.message = message; - if (typeof Error.captureStackTrace === 'function') { - Error.captureStackTrace(this, this.constructor); - } else { - this.stack = (new Error(message)).stack; - } - } -} - -module.exports = AppError; http://git-wip-us.apache.org/repos/asf/ignite/blob/020c96a6/modules/web-console/src/main/js/serve/errors/AppErrorException.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/errors/AppErrorException.js b/modules/web-console/src/main/js/serve/errors/AppErrorException.js new file mode 100644 index 0000000..208b09b --- /dev/null +++ b/modules/web-console/src/main/js/serve/errors/AppErrorException.js @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +class AppErrorException extends Error { + constructor(message) { + super(message); + + this.name = this.constructor.name; + this.code = 400; + this.httpCode = 400; + this.message = message; + + if (typeof Error.captureStackTrace === 'function') + Error.captureStackTrace(this, this.constructor); + else + this.stack = (new Error(message)).stack; + } +} + +module.exports = AppErrorException; http://git-wip-us.apache.org/repos/asf/ignite/blob/020c96a6/modules/web-console/src/main/js/serve/errors/DuplicateKeyException.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/errors/DuplicateKeyException.js b/modules/web-console/src/main/js/serve/errors/DuplicateKeyException.js index b88224f..80b0147 100644 --- a/modules/web-console/src/main/js/serve/errors/DuplicateKeyException.js +++ b/modules/web-console/src/main/js/serve/errors/DuplicateKeyException.js @@ -17,9 +17,9 @@ 'use strict'; -import AppError from './AppError'; +import AppErrorException from './AppError'; -class DuplicateKeyException extends AppError { +class DuplicateKeyException extends AppErrorException { constructor(message) { super(message); } http://git-wip-us.apache.org/repos/asf/ignite/blob/020c96a6/modules/web-console/src/main/js/serve/errors/ServerError.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/errors/ServerError.js b/modules/web-console/src/main/js/serve/errors/ServerError.js deleted file mode 100644 index e685a41..0000000 --- a/modules/web-console/src/main/js/serve/errors/ServerError.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -class ServerError extends Error { - constructor(message) { - super(message); - this.name = this.constructor.name; - this.code = 500; - this.httpCode = 500; - this.message = message; - Error.captureStackTrace(this, this.constructor.name) - } -} - -module.exports = ServerError; http://git-wip-us.apache.org/repos/asf/ignite/blob/020c96a6/modules/web-console/src/main/js/serve/errors/ServerErrorException.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/errors/ServerErrorException.js b/modules/web-console/src/main/js/serve/errors/ServerErrorException.js new file mode 100644 index 0000000..439755e --- /dev/null +++ b/modules/web-console/src/main/js/serve/errors/ServerErrorException.js @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +class ServerErrorException extends Error { + constructor(message) { + super(message); + + this.name = this.constructor.name; + this.code = 500; + this.httpCode = 500; + this.message = message; + + if (typeof Error.captureStackTrace === 'function') + Error.captureStackTrace(this, this.constructor); + else + this.stack = (new Error(message)).stack; + } +} + +module.exports = ServerErrorException; http://git-wip-us.apache.org/repos/asf/ignite/blob/020c96a6/modules/web-console/src/main/js/serve/errors/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/serve/errors/index.js b/modules/web-console/src/main/js/serve/errors/index.js index 5c692d5..9e3a1b0 100644 --- a/modules/web-console/src/main/js/serve/errors/index.js +++ b/modules/web-console/src/main/js/serve/errors/index.js @@ -22,8 +22,8 @@ module.exports = { implements: 'errors', factory: () => ({ - AppError: require('./AppError'), + AppErrorException: require('./AppErrorException'), DuplicateKeyException: require('./DuplicateKeyException'), - ServerError: require('./ServerError') + ServerErrorException: require('./ServerErrorException') }) -}; \ No newline at end of file +};
