StackStorm/st2

Predictive error message when config hasn't been loaded

開放

#3,435 建立於 2017年5月25日

 (1 則留言) (0 個反應) (0 位負責人)Python (740 個分叉)batch import
documentationfeaturegood first issue

倉庫指標

星標
 (5,794 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

I've done support a few times now and one of the most common problems arises from the fact that someone has changed a pack config file but haven't reloaded it.

The error message that usually pops up is a KeyError, since the action or sensor will likely be looking up some key in the config that may not exist in the config stored in the database. However, for some packs, where the default configuration is provided with some dummy values, this may not always be the case

It may be worth putting some thought into how we can detect whether or not the configuration has been reloaded recently, and provide something useful to the user that indicates this is what they should do. At the very least, we should catch "common" exceptions like KeyError and provide this additional context before re-raising.

貢獻者指南