Skip to content
Browse files

Merge branch 'v0.12'

  • Loading branch information...
2 parents ebab04b + bada9ce commit 68b24f13ea48537e51213ea68d7f9d4d49e200bf @mde mde committed Feb 5, 2014
Showing with 14 additions and 2 deletions.
  1. +1 −0 lib/controller/responder/index.js
  2. +11 −0 lib/controller/responder/strategies/api.js
  3. +2 −2 package.json
View
1 lib/controller/responder/index.js
@@ -18,6 +18,7 @@ responder.strategies = {
html: htmlStrategy
, json: apiStrategy
, xml: apiStrategy
+, txt: apiStrategy
};
responder.Responder = function () {
View
11 lib/controller/responder/strategies/api.js
@@ -60,7 +60,18 @@ var utils = require('utilities')
, message: content.message
, stack: content.stack
};
+
+ // Transfer the statusCode from the Error object to the
+ // options, to be spit out in the response
options.statusCode = content.statusCode || 500;
+
+ // Plaintext needs a reasonable way to get a string other
+ // than stupid [Object object]
+ if (options.format == 'txt') {
+ response.toString = function () {
+ return this.message;
+ };
+ }
}
else {
throw new Error(
View
4 package.json
@@ -8,7 +8,7 @@
"MVC",
"realtime"
],
- "version": "0.12.3",
+ "version": "0.12.4",
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
"dependencies": {
"jake": "0.7.x",
@@ -27,7 +27,7 @@
"main": "./lib/geddy",
"repository": {
"type": "git",
- "url": "git://github.com/mde/geddy.git"
+ "url": "git://github.com/geddy/geddy.git"
},
"preferGlobal": true,
"devDependencies": {

0 comments on commit 68b24f1

Please sign in to comment.
Something went wrong with that request. Please try again.