Last active
August 29, 2015 13:56
-
-
Save StoneCypher/9046883 to your computer and use it in GitHub Desktop.
Example DSL for error reporting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// spaces/tabs separate unless preceded with a comma, which makes list members, or surrounded by '', which makes js string notation | |
// first is operator; after that are expected-length varargs like irc | |
// 2nd argument to thanks is list of front of string matches for things raised by keyword report | |
thanks_alias everybody aaron, becca, carl, dana, eric, farah | |
thanks_alias everybody gerry, heddy | |
thanks_alias engineering aaron, becca, farah | |
thanks_alias qa dana, eric | |
thanks_target http://some.site/error_reporting/ | |
thanks_log archive | |
thanks_rageface enable | |
thanks aaron 'Object Undefined:' | |
thanks becca server.50 | |
thanks carl user.no_referrer, user.missing_data, user.contact_invalid | |
thanks dana art.no_asset, art.wrong_resolution | |
thanks dana, art art.asset_corrupt | |
thanks eric i18n. | |
thanks farah outage., ops. | |
thanks gerry tcp. | |
thanks heddy bot., ddos. | |
thanks art, qa art.placeholder_asset | |
thanks art art. | |
thanks security security. | |
thanks ops, frontend ajax. | |
thanks everybody user_complaint. | |
thanks everybody severe. | |
thanks engineering undefined | |
// in practice | |
$.ajax(whatever) | |
.done(...) | |
.fail(function(data) { | |
report 'ajax.no_connection'; | |
}) | |
// also, if you are puerile like i am, and still think "thanks, obama" is funny | |
// you can define an alias called obama which goes to whoever handles catch-all | |
// events, which i would generally expect to be engineering broadcast | |
// | |
// then you would get to write the rule | |
// | |
// thanks obama undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment