Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Silent failures are disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Mitros committed Jan 20, 2015
1 parent 44d66a1 commit 35a0c31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ lazy

# XBlock
# This is not in/from PyPi, since it moves fast
-e git+https://github.com/edx/XBlock.git@9c634481dfc85a17dcb3351ca232d7098a38e10e#egg=XBlock
-e git+https://github.com/edx/XBlock.git@8e496cff186ed33cf92964faab13ccb3691ee211#egg=XBlock
#-e ../XBlock

# Acid xblock
Expand Down
12 changes: 7 additions & 5 deletions workbench/scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def remove_scenario(scname):
del SCENARIOS[scname]


def add_class_scenarios(class_name, cls):
def add_class_scenarios(class_name, cls, fail_silently=True):
"""
Add scenarios from a class to the global collection of scenarios.
"""
Expand All @@ -54,8 +54,10 @@ def add_class_scenarios(class_name, cls):
add_xml_scenario(scname, desc, xml)
except Exception:
# don't allow a single bad scenario to block the whole workbench
log.warning(u"Cannot load %s", desc, exc_info=True)

if fail_silently:
log.warning(u"Cannot load %s", desc, exc_info=True)
else:
raise

def init_scenarios():
"""
Expand All @@ -69,5 +71,5 @@ def init_scenarios():
WORKBENCH_KVS.prep_for_scenario_loading()

# Get all the XBlock classes, and add their scenarios.
for class_name, cls in sorted(XBlock.load_classes()):
add_class_scenarios(class_name, cls)
for class_name, cls in sorted(XBlock.load_classes(fail_silently=False)):
add_class_scenarios(class_name, cls, fail_silently=False)

0 comments on commit 35a0c31

Please sign in to comment.