You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/10/18 22:58:08 UTC

[GitHub] [tvm] electriclilies opened a new pull request #9311: [Error reporting] Replace runtime errors with LOG(FATAL)

electriclilies opened a new pull request #9311:
URL: https://github.com/apache/tvm/pull/9311


   There are some places in the codebase where people throw runtime errors from the standard library. This is not good because runtime errors do not produce a stack trace. 
   
   In this PR, I replace all the runtime errors with LOG(FATAL)


-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] masahi merged pull request #9311: [Error reporting] Replace runtime errors with LOG(FATAL)

Posted by GitBox <gi...@apache.org>.
masahi merged pull request #9311:
URL: https://github.com/apache/tvm/pull/9311


   


-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] electriclilies commented on pull request #9311: [Error reporting] Replace runtime errors with LOG(FATAL)

Posted by GitBox <gi...@apache.org>.
electriclilies commented on pull request #9311:
URL: https://github.com/apache/tvm/pull/9311#issuecomment-948806402


   Thanks all!


-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] junrushao1994 commented on a change in pull request #9311: [Error reporting] Replace runtime errors with LOG(FATAL)

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on a change in pull request #9311:
URL: https://github.com/apache/tvm/pull/9311#discussion_r731379485



##########
File path: src/ir/module.cc
##########
@@ -170,7 +170,7 @@ Constructor IRModuleNode::GetConstructor(const String& adt, const String& cons)
   }
 
   LOG(FATAL) << adt << " does not contain constructor " << cons;
-  throw std::runtime_error("Constructor Not Found.");
+  return {};

Review comment:
       BTW, there is no essential difference though (so i'm not suggesting change here), but just wanted to share an interesting trick I learned to avoid faking return arguments after `LOG(FATAL)`: we might just use an empty throw statement like:
   
   ```c++
   throw;
   ```




-- 
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: commits-unsubscribe@tvm.apache.org

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



[GitHub] [tvm] electriclilies commented on a change in pull request #9311: [Error reporting] Replace runtime errors with LOG(FATAL)

Posted by GitBox <gi...@apache.org>.
electriclilies commented on a change in pull request #9311:
URL: https://github.com/apache/tvm/pull/9311#discussion_r731399992



##########
File path: src/ir/module.cc
##########
@@ -170,7 +170,7 @@ Constructor IRModuleNode::GetConstructor(const String& adt, const String& cons)
   }
 
   LOG(FATAL) << adt << " does not contain constructor " << cons;
-  throw std::runtime_error("Constructor Not Found.");
+  return {};

Review comment:
       oh good tip! thanks :) 




-- 
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: commits-unsubscribe@tvm.apache.org

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