You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "CRZbulabula (via GitHub)" <gi...@apache.org> on 2025/12/11 05:26:25 UTC

[PR] [AINode] More accurate exception for model management [iotdb]

CRZbulabula opened a new pull request, #16895:
URL: https://github.com/apache/iotdb/pull/16895

   Refactor the exception throw for clear error handling.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AINode] More accurate exception for model management [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16895:
URL: https://github.com/apache/iotdb/pull/16895#issuecomment-3640420956

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16895) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16895&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16895&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16895&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16895&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16895&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16895)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AINode] More accurate exception for model management [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16895:
URL: https://github.com/apache/iotdb/pull/16895#issuecomment-3640567666

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16895) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16895&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16895&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16895&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16895&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16895&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16895)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AINode] More accurate exception for model management [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16895:
URL: https://github.com/apache/iotdb/pull/16895#issuecomment-3640218722

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16895) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16895&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16895&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16895&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16895&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16895&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16895)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AINode] More accurate exception for model management [iotdb]

Posted by "CRZbulabula (via GitHub)" <gi...@apache.org>.
CRZbulabula merged PR #16895:
URL: https://github.com/apache/iotdb/pull/16895


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AINode] More accurate exception for model management [iotdb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #16895:
URL: https://github.com/apache/iotdb/pull/16895#discussion_r2609398542


##########
iotdb-core/ainode/iotdb/ainode/core/model/model_storage.py:
##########
@@ -481,41 +474,43 @@ def delete_model(self, model_id: str) -> None:
                     model_info = category_dict[model_id]
                     category_value = cat_value
                     break
-
             if not model_info:
                 logger.warning(f"Model {model_id} does not exist, cannot delete")
-                return
-
+                raise ModelNotExistException(model_id)
             if model_info.category == ModelCategory.BUILTIN:
-                raise BuiltInModelDeletionError(model_id)
+                logger.warning(f"Model {model_id} is builtin, cannot delete")
+                raise BuiltInModelDeletionException(model_id)
             model_info.state = ModelStates.DROPPING
             model_path = os.path.join(
                 self._models_dir, model_info.category.value, model_id
             )
-            if model_path.exists():
+            if os.path.exists(model_path):
                 try:
                     shutil.rmtree(model_path)
-                    logger.info(f"Deleted model directory: {model_path}")
+                    logger.info(f"Model directory is deleted: {model_path}")
                 except Exception as e:
                     logger.error(f"Failed to delete model directory {model_path}: {e}")
-                    raise
-
-            if category_value and model_id in self._models[category_value]:
-                del self._models[category_value][model_id]
-                logger.info(f"Model {model_id} has been removed from storage")
-
-        return
+                    model_info.state = (
+                        ModelStates.ACTIVE
+                    )  # Revert state update on failure
+                    raise e

Review Comment:
   The model deletion logic has a potential issue. If the model directory does not exist (line 487 condition is false), the state will remain as DROPPING and the model entry will be deleted from the dictionary (line 497). This could leave the system in an inconsistent state if the model directory never existed. Consider either raising an exception or logging this as a warning before deletion, or ensure the state is properly handled even when the directory doesn't exist.
   ```suggestion
                       raise e
               else:
                   logger.warning(f"Model directory {model_path} does not exist when deleting model {model_id}")
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/model/model_storage.py:
##########
@@ -249,9 +266,9 @@ def register_model(self, model_id: str, uri: str) -> bool:
         ensure_init_file(model_dir)
 
         if uri_type == UriType.REPO:
-            self._fetch_model_from_hf_repo(parsed_uri, model_dir)
+            _fetch_model_from_hf_repo(parsed_uri, model_dir)

Review Comment:
   The parse_uri_type function only accepts URIs starting with "file://" and raises an exception for all other URIs, but the register_model method (line 268) still checks for UriType.REPO and calls _fetch_model_from_hf_repo. This means the REPO code path is unreachable because parse_uri_type will raise InvalidModelUriException before reaching line 268. Either update parse_uri_type to support "repo://" URIs or remove the unreachable REPO handling code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AINode] More accurate exception for model management [iotdb]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16895:
URL: https://github.com/apache/iotdb/pull/16895#issuecomment-3640732163

   ## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/16895?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `58.82353%` with `7 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 39.02%. Comparing base ([`94461b0`](https://app.codecov.io/gh/apache/iotdb/commit/94461b065095dd8499c85b8691d89da35a878299?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a553cb6`](https://app.codecov.io/gh/apache/iotdb/commit/a553cb6b0f2ab4fda7b008c3b9522fcac235d2ee?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iotdb/pull/16895?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ion/config/executor/ClusterConfigTaskExecutor.java](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fexecution%2Fconfig%2Fexecutor%2FClusterConfigTaskExecutor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9leGVjdXRpb24vY29uZmlnL2V4ZWN1dG9yL0NsdXN0ZXJDb25maWdUYXNrRXhlY3V0b3IuamF2YQ==) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...tdb/db/exception/ainode/GetModelInfoException.java](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fexception%2Fainode%2FGetModelInfoException.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvZXhjZXB0aW9uL2Fpbm9kZS9HZXRNb2RlbEluZm9FeGNlcHRpb24uamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...ache/iotdb/db/protocol/client/an/AINodeClient.java](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fprotocol%2Fclient%2Fan%2FAINodeClient.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcHJvdG9jb2wvY2xpZW50L2FuL0FJTm9kZUNsaWVudC5qYXZh) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../plan/execution/config/TableConfigTaskVisitor.java](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fexecution%2Fconfig%2FTableConfigTaskVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9leGVjdXRpb24vY29uZmlnL1RhYmxlQ29uZmlnVGFza1Zpc2l0b3IuamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...e/plan/execution/config/TreeConfigTaskVisitor.java](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fexecution%2Fconfig%2FTreeConfigTaskVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9leGVjdXRpb24vY29uZmlnL1RyZWVDb25maWdUYXNrVmlzaXRvci5qYXZh) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...execution/config/metadata/ai/CreateTuningTask.java](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&filepath=iotdb-core%2Fdatanode%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fiotdb%2Fdb%2Fqueryengine%2Fplan%2Fexecution%2Fconfig%2Fmetadata%2Fai%2FCreateTuningTask.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW90ZGItY29yZS9kYXRhbm9kZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvaW90ZGIvZGIvcXVlcnllbmdpbmUvcGxhbi9leGVjdXRpb24vY29uZmlnL21ldGFkYXRhL2FpL0NyZWF0ZVR1bmluZ1Rhc2suamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/iotdb/pull/16895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #16895   +/-   ##
   =========================================
     Coverage     39.02%   39.02%           
     Complexity      207      207           
   =========================================
     Files          5022     5021    -1     
     Lines        333375   333373    -2     
     Branches      42431    42431           
   =========================================
   + Hits         130105   130106    +1     
   + Misses       203270   203267    -3     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/iotdb/pull/16895?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [AINode] More accurate exception for model management [iotdb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #16895:
URL: https://github.com/apache/iotdb/pull/16895#discussion_r2609224181


##########
iotdb-core/ainode/iotdb/ainode/core/model/model_storage.py:
##########
@@ -481,41 +474,40 @@ def delete_model(self, model_id: str) -> None:
                     model_info = category_dict[model_id]
                     category_value = cat_value
                     break
-
             if not model_info:
                 logger.warning(f"Model {model_id} does not exist, cannot delete")
-                return
-
+                raise ModelNotExistException(model_id)
             if model_info.category == ModelCategory.BUILTIN:
-                raise BuiltInModelDeletionError(model_id)
+                logger.warning(f"Model {model_id} is builtin, cannot delete")
+                raise BuiltInModelDeletionException(model_id)
             model_info.state = ModelStates.DROPPING
             model_path = os.path.join(
                 self._models_dir, model_info.category.value, model_id
             )
-            if model_path.exists():
+            if os.path.exists(model_path):
                 try:
                     shutil.rmtree(model_path)
-                    logger.info(f"Deleted model directory: {model_path}")
+                    logger.info(f"Model directory is deleted: {model_path}")
                 except Exception as e:
                     logger.error(f"Failed to delete model directory {model_path}: {e}")
-                    raise
-
-            if category_value and model_id in self._models[category_value]:
-                del self._models[category_value][model_id]
-                logger.info(f"Model {model_id} has been removed from storage")
-
-        return
+                    raise e
+            del self._models[category_value][model_id]

Review Comment:
   If the shutil.rmtree operation fails (line 489-493), an exception is raised but the model remains in DROPPING state in the _models dictionary. The model is never removed from the dictionary in this failure case, potentially leaving the system in an inconsistent state. Consider either reverting the state or removing the model from the dictionary even if file deletion fails, with appropriate error handling.



##########
iotdb-core/ainode/iotdb/ainode/core/manager/model_manager.py:
##########
@@ -16,12 +16,16 @@
 # under the License.
 #
 
-from typing import Any, List, Optional
+from typing import List, Optional

Review Comment:
   Import of 'List' is not used.
   ```suggestion
   from typing import Optional
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/model/utils.py:
##########
@@ -96,3 +104,28 @@ def ensure_init_file(dir_path: str):
     if not os.path.exists(init_file):
         with open(init_file, "w"):
             pass
+
+
+def _fetch_model_from_local(source_path: str, storage_path: str):
+    logger.info(f"Copying model from local path: {source_path} -> {storage_path}")
+    source_dir = Path(source_path)
+    storage_dir = Path(storage_path)
+    for file in source_dir.iterdir():
+        if file.is_file():
+            shutil.copy2(file, storage_dir / file.name)
+
+

Review Comment:
   The _fetch_model_from_local function doesn't validate that source_path exists or is a directory before attempting to iterate over it. This could lead to unclear error messages if the path doesn't exist. Consider adding validation with InvalidModelUriException similar to how the old implementation handled this.
   ```suggestion
       if not source_dir.exists():
           raise InvalidModelUriException(f"Source path does not exist: {source_path}")
       if not source_dir.is_dir():
           raise InvalidModelUriException(f"Source path is not a directory: {source_path}")
       storage_dir = Path(storage_path)
       for file in source_dir.iterdir():
           if file.is_file():
               shutil.copy2(file, storage_dir / file.name)
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([BadNodeUrlException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
           self.message = "Bad node url: {}".format(node_url)
           super().__init__(self.message)
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([MissingOptionException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, config_name: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):
         self.message = "Wrong type for config: {0}, expected: {1}".format(
             config_name, expected_type
         )
 
 
-class UnsupportedError(_BaseError):
+class UnsupportedException(_BaseException):
     def __init__(self, msg: str):
         self.message = "{0} is not supported in current version".format(msg)
 
 
-class InvalidUriError(_BaseError):
+class InvalidUriException(_BaseException):
     def __init__(self, uri: str):
         self.message = "Invalid uri: {}, there are no {} or {} under this uri.".format(
             uri, MODEL_WEIGHTS_FILE_IN_PT, MODEL_CONFIG_FILE_IN_YAML
         )
 
 
-class InvalidWindowArgumentError(_BaseError):
+class InvalidWindowArgumentException(_BaseException):
     def __init__(self, window_interval, window_step, dataset_length):
         self.message = f"Invalid inference input: window_interval {window_interval}, window_step {window_step}, dataset_length {dataset_length}"
 
 
-class InferenceModelInternalError(_BaseError):
+class InferenceModelInternalException(_BaseException):
     def __init__(self, msg: str):
         self.message = "Inference model internal error: {0}".format(msg)
 
 
-class BuiltInModelNotSupportError(_BaseError):
+class BuiltInModelNotSupportException(_BaseException):
     def __init__(self, msg: str):
         self.message = "Built-in model not support: {0}".format(msg)
 
 
-class BuiltInModelDeletionError(_BaseError):
-    def __init__(self, model_id: str):
-        self.message = "Cannot delete built-in model: {0}".format(model_id)
-
-
-class WrongAttributeTypeError(_BaseError):
+class WrongAttributeTypeException(_BaseException):
     def __init__(self, attribute_name: str, expected_type: str):
         self.message = "Wrong type for attribute: {0}, expected: {1}".format(
             attribute_name, expected_type
         )
 
 
-class NumericalRangeException(_BaseError):
+class NumericalRangeException(_BaseException):
     def __init__(self, attribute_name: str, value, min_value, max_value):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([NumericalRangeException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, attribute_name: str, value, min_value, max_value):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -120,14 +137,14 @@ def __init__(self, attribute_name: str, value, min_value, max_value):
         )
 
 
-class StringRangeException(_BaseError):
+class StringRangeException(_BaseException):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([StringRangeException.__init__](2) may be missing a call to a base class __init__)



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([ModelExistedException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, model_id: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)

Review Comment:
   The error message has a grammatical error: "Model {} is not exists" should be "Model {} does not exist".
   ```suggestion
           self.message = "Model {} does not exist".format(model_id)
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([InvalidModelUriException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, msg: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/model/model_storage.py:
##########
@@ -233,12 +239,23 @@ def _process_user_defined_model_directory(self, model_dir: str, model_id: str):
 
     # ==================== Registration Methods ====================
 
-    def register_model(self, model_id: str, uri: str) -> bool:
+    def register_model(self, model_id: str, uri: str):
         """
-        Supported URI formats:
-            - repo://<huggingface_repo_id> (Maybe in the future)
-            - file://<local_path>
+        Register a user-defined model from a given URI.
+        Args:
+            model_id (str): Unique identifier for the model.
+            uri (str): URI to fetch the model from.
+            Supported URI formats:
+                - file://<local_path>
+                - repo://<huggingface_repo_id> (Maybe in the future)
+        Raises:
+            ModelExistedError: If the model_id already exists.
+            InvalidModelUriError: If the URI format is invalid.

Review Comment:
   The docstring mentions "ModelExistedError" and "InvalidModelUriError" but the actual exception names are "ModelExistedException" and "InvalidModelUriException". The docstring should be updated to reflect the correct exception class names.
   ```suggestion
               ModelExistedException: If the model_id already exists.
               InvalidModelUriException: If the URI format is invalid.
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([WrongTypeConfigException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, config_name: str, expected_type: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([ModelNotExistException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, model_id: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([BuiltInModelDeletionException.__init__](2) may be missing a call to a base class __init__)



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):
         self.message = "Wrong type for config: {0}, expected: {1}".format(
             config_name, expected_type
         )
 
 
-class UnsupportedError(_BaseError):
+class UnsupportedException(_BaseException):
     def __init__(self, msg: str):
         self.message = "{0} is not supported in current version".format(msg)
 
 
-class InvalidUriError(_BaseError):
+class InvalidUriException(_BaseException):
     def __init__(self, uri: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([InvalidUriException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, uri: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([BadConfigValueException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, config_name: str, config_value, hint: str = ""):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([RedundantOptionException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, option_name: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([MissingConfigException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, config_name: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):
         self.message = "Wrong type for config: {0}, expected: {1}".format(
             config_name, expected_type
         )
 
 
-class UnsupportedError(_BaseError):
+class UnsupportedException(_BaseException):
     def __init__(self, msg: str):
         self.message = "{0} is not supported in current version".format(msg)
 
 
-class InvalidUriError(_BaseError):
+class InvalidUriException(_BaseException):
     def __init__(self, uri: str):
         self.message = "Invalid uri: {}, there are no {} or {} under this uri.".format(
             uri, MODEL_WEIGHTS_FILE_IN_PT, MODEL_CONFIG_FILE_IN_YAML
         )
 
 
-class InvalidWindowArgumentError(_BaseError):
+class InvalidWindowArgumentException(_BaseException):
     def __init__(self, window_interval, window_step, dataset_length):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([InvalidWindowArgumentException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, window_interval, window_step, dataset_length):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):
         self.message = "Wrong type for config: {0}, expected: {1}".format(
             config_name, expected_type
         )
 
 
-class UnsupportedError(_BaseError):
+class UnsupportedException(_BaseException):
     def __init__(self, msg: str):
         self.message = "{0} is not supported in current version".format(msg)
 
 
-class InvalidUriError(_BaseError):
+class InvalidUriException(_BaseException):
     def __init__(self, uri: str):
         self.message = "Invalid uri: {}, there are no {} or {} under this uri.".format(
             uri, MODEL_WEIGHTS_FILE_IN_PT, MODEL_CONFIG_FILE_IN_YAML
         )
 
 
-class InvalidWindowArgumentError(_BaseError):
+class InvalidWindowArgumentException(_BaseException):
     def __init__(self, window_interval, window_step, dataset_length):
         self.message = f"Invalid inference input: window_interval {window_interval}, window_step {window_step}, dataset_length {dataset_length}"
 
 
-class InferenceModelInternalError(_BaseError):
+class InferenceModelInternalException(_BaseException):
     def __init__(self, msg: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([InferenceModelInternalException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, msg: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -120,14 +137,14 @@ def __init__(self, attribute_name: str, value, min_value, max_value):
         )
 
 
-class StringRangeException(_BaseError):
+class StringRangeException(_BaseException):
     def __init__(self, attribute_name: str, value: str, expect_value):
         self.message = "Attribute {0} expect value in {1}, got {2} instead.".format(
             attribute_name, expect_value, value
         )
 
 
-class ListRangeException(_BaseError):
+class ListRangeException(_BaseException):
     def __init__(self, attribute_name: str, value: list, expected_type: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([ListRangeException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, attribute_name: str, value: list, expected_type: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):
         self.message = "Wrong type for config: {0}, expected: {1}".format(
             config_name, expected_type
         )
 
 
-class UnsupportedError(_BaseError):
+class UnsupportedException(_BaseException):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([UnsupportedException.__init__](2) may be missing a call to a base class __init__)



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):
         self.message = "Wrong type for config: {0}, expected: {1}".format(
             config_name, expected_type
         )
 
 
-class UnsupportedError(_BaseError):
+class UnsupportedException(_BaseException):
     def __init__(self, msg: str):
         self.message = "{0} is not supported in current version".format(msg)
 
 
-class InvalidUriError(_BaseError):
+class InvalidUriException(_BaseException):
     def __init__(self, uri: str):
         self.message = "Invalid uri: {}, there are no {} or {} under this uri.".format(
             uri, MODEL_WEIGHTS_FILE_IN_PT, MODEL_CONFIG_FILE_IN_YAML
         )
 
 
-class InvalidWindowArgumentError(_BaseError):
+class InvalidWindowArgumentException(_BaseException):
     def __init__(self, window_interval, window_step, dataset_length):
         self.message = f"Invalid inference input: window_interval {window_interval}, window_step {window_step}, dataset_length {dataset_length}"
 
 
-class InferenceModelInternalError(_BaseError):
+class InferenceModelInternalException(_BaseException):
     def __init__(self, msg: str):
         self.message = "Inference model internal error: {0}".format(msg)
 
 
-class BuiltInModelNotSupportError(_BaseError):
+class BuiltInModelNotSupportException(_BaseException):
     def __init__(self, msg: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([BuiltInModelNotSupportException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, msg: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -33,85 +33,102 @@ def __str__(self) -> str:
         return self.message
 
 
-class BadNodeUrlError(_BaseError):
+class BadNodeUrlException(_BaseException):
     def __init__(self, node_url: str):
         self.message = "Bad node url: {}".format(node_url)
 
 
-class ModelNotExistError(_BaseError):
+# ==================== Model Management ====================
+
+
+class ModelExistedException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} already exists".format(model_id)
+
+
+class ModelNotExistException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Model {} is not exists".format(model_id)
+
+
+class InvalidModelUriException(_BaseException):
     def __init__(self, msg: str):
-        self.message = "Model is not exists: {} ".format(msg)
+        self.message = (
+            "Model registration failed because the specified uri is invalid: {}".format(
+                msg
+            )
+        )
+
+
+class BuiltInModelDeletionException(_BaseException):
+    def __init__(self, model_id: str):
+        self.message = "Cannot delete built-in model: {}".format(model_id)
 
 
-class BadConfigValueError(_BaseError):
+class BadConfigValueException(_BaseException):
     def __init__(self, config_name: str, config_value, hint: str = ""):
         self.message = "Bad value [{0}] for config {1}. {2}".format(
             config_value, config_name, hint
         )
 
 
-class MissingConfigError(_BaseError):
+class MissingConfigException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing config: {}".format(config_name)
 
 
-class MissingOptionError(_BaseError):
+class MissingOptionException(_BaseException):
     def __init__(self, config_name: str):
         self.message = "Missing task option: {}".format(config_name)
 
 
-class RedundantOptionError(_BaseError):
+class RedundantOptionException(_BaseException):
     def __init__(self, option_name: str):
         self.message = "Redundant task option: {}".format(option_name)
 
 
-class WrongTypeConfigError(_BaseError):
+class WrongTypeConfigException(_BaseException):
     def __init__(self, config_name: str, expected_type: str):
         self.message = "Wrong type for config: {0}, expected: {1}".format(
             config_name, expected_type
         )
 
 
-class UnsupportedError(_BaseError):
+class UnsupportedException(_BaseException):
     def __init__(self, msg: str):
         self.message = "{0} is not supported in current version".format(msg)
 
 
-class InvalidUriError(_BaseError):
+class InvalidUriException(_BaseException):
     def __init__(self, uri: str):
         self.message = "Invalid uri: {}, there are no {} or {} under this uri.".format(
             uri, MODEL_WEIGHTS_FILE_IN_PT, MODEL_CONFIG_FILE_IN_YAML
         )
 
 
-class InvalidWindowArgumentError(_BaseError):
+class InvalidWindowArgumentException(_BaseException):
     def __init__(self, window_interval, window_step, dataset_length):
         self.message = f"Invalid inference input: window_interval {window_interval}, window_step {window_step}, dataset_length {dataset_length}"
 
 
-class InferenceModelInternalError(_BaseError):
+class InferenceModelInternalException(_BaseException):
     def __init__(self, msg: str):
         self.message = "Inference model internal error: {0}".format(msg)
 
 
-class BuiltInModelNotSupportError(_BaseError):
+class BuiltInModelNotSupportException(_BaseException):
     def __init__(self, msg: str):
         self.message = "Built-in model not support: {0}".format(msg)
 
 
-class BuiltInModelDeletionError(_BaseError):
-    def __init__(self, model_id: str):
-        self.message = "Cannot delete built-in model: {0}".format(model_id)
-
-
-class WrongAttributeTypeError(_BaseError):
+class WrongAttributeTypeException(_BaseException):
     def __init__(self, attribute_name: str, expected_type: str):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([WrongAttributeTypeException.__init__](2) may be missing a call to a base class __init__)
   ```suggestion
       def __init__(self, attribute_name: str, expected_type: str):
           super().__init__()
   ```



##########
iotdb-core/ainode/iotdb/ainode/core/exception.py:
##########
@@ -136,7 +153,7 @@ def __init__(self, attribute_name: str, value: list, expected_type: str):
         )
 
 
-class AttributeNotSupportError(_BaseError):
+class AttributeNotSupportException(_BaseException):

Review Comment:
   This class does not call [_BaseException.__init__](1) during initialization. ([AttributeNotSupportException.__init__](2) may be missing a call to a base class __init__)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org