Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Stop having the extremely weird api for doing synchronous work, split…

… tests in 2 seperate files, one for async and one for sync.
  • Loading branch information...
commit 8e7fb9ed9467c6b56ef5152ddee97dfcfa0cad12 1 parent 05da045
@kesla authored
View
52 lib/snappy.js
@@ -52,7 +52,7 @@ exports.compress = function(input, callback) {
}
input = new Buffer(input);
}
- return binding.compress(input, callback);
+ binding.compress(input, callback);
};
/**
@@ -60,28 +60,43 @@ exports.compress = function(input, callback) {
* If input isn't a string or buffer, automatically convert to buffer by using
* JSON.stringify.
*/
-exports.compressSync = function(input, callback) {
+exports.compressSync = function(input) {
if(!Buffer.isBuffer(input)){
if (!(typeof input === 'string')) {
input = JSON.stringify(input);
}
input = new Buffer(input);
}
- return binding.compressSync(input, callback);
+ var result;
+ var err;
+ binding.compressSync(input, function(e, r) {
+ result = r;
+ err = e;
+ });
+ if(err) {
+ throw err;
+ }
+ return result;
};
/**
* Asyncronous decide if a buffer is compressed in a correct way.
*/
-exports.isValidCompressed = function(input, callback) {
- return binding.isValidCompressed(input, callback);
-};
+exports.isValidCompressed = binding.isValidCompressed;
/**
* Syncronous decide if a buffer is compressed in a correct way.
*/
exports.isValidCompressedSync = function(input, callback) {
- return binding.isValidCompressedSync(input, callback);
+ var err, result;
+ binding.isValidCompressedSync(input, function(e, r) {
+ err = e;
+ result = r;
+ });
+ if(err) {
+ throw err;
+ }
+ return result;
};
/**
@@ -92,11 +107,11 @@ exports.uncompress = function(compressed, callback, parse) {
if (parse == null) {
parse = parsers.raw;
}
- return binding.uncompress(compressed, function(err, data) {
+ binding.uncompress(compressed, function(err, data) {
if (data != null) {
data = parse(data);
}
- return callback(err, data);
+ callback(err, data);
});
};
@@ -109,16 +124,23 @@ exports.decompress = exports.uncompress;
* Syncronous uncompress previously compressed data.
* A parser can be attached. If no parser is attached, return buffer.
*/
-exports.uncompressSync = function(compressed, callback, parse) {
- if (parse == null) {
+exports.uncompressSync = function(compressed, parse) {
+ if (!parse) {
parse = parsers.raw;
}
- return binding.uncompressSync(compressed, function(err, data) {
- if (data != null) {
- data = parse(data);
+ var err, data;
+
+ binding.uncompressSync(compressed, function(e, d) {
+ if (d) {
+ d = parse(d);
}
- return callback(err, data);
+ err = e;
+ data = d;
});
+ if(err) {
+ throw err;
+ }
+ return data;
};
/**
View
2  package.json
@@ -13,7 +13,7 @@
"lib": "."
},
"scripts": {
- "test": "vows test.js --spec"
+ "test": "vows --spec -i"
},
"engines": {
"node": ">= 0.4.5"
View
253 test/all.js
@@ -1,253 +0,0 @@
-/*
- Copyright (c) 2011 David Björklund
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-*/
-
-var snappy = require('../lib/snappy');
-var vows = require('vows');
-var assert = require('assert');
-
-// Convenient helper method
-assert.isError = function(err) {
- return assert.instanceOf(err, Error);
-};
-
-// Test data
-var string = "foo foo foo Fasfa daos asd foo foo foo asdasf bar bar aarr";
-var buffer = new Buffer([255, 200, 100, 3, 0, 256, 80]);
-var json = {
- "foo": "bar",
- "fou": 0,
- "shou": "ho ho",
- "what?": ["hey", "you"]
-};
-
-// Use same test to test both sync and async versions of the snappy-methods.
-["", "Sync"].forEach(function(sync) {
- //
- // Define method aliases to synchronous or asyncronous versions of the
- // methods. For example, compress will point to snappy.compress or
- // snappy.compressSync
- //
- var compress = snappy["compress" + sync];
- var decompress = snappy["decompress" + sync];
- var isValidCompressed = snappy["isValidCompressed" + sync];
-
- // Give the test runs a good title
- var title = sync === "" ? "asyncronous" : "synchrosnous";
-
- // Describe the test suite
- return vows.describe("snappy (" + title + " versions)").addBatch({
- "compress": {
- "Buffer": {
- topic: function() {
- return compress(buffer, this.callback);
- },
- 'should not have errors': function(err, compressed) {
- return assert.isNull(err);
- },
- 'should result in a buffer': function(err, compressed) {
- return Buffer.isBuffer(compressed);
- },
- 'and isValidCompressed': {
- topic: function(compressed) {
- return isValidCompressed(compressed, this.callback);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in true': function(err, result) {
- return assert.isTrue(result);
- }
- },
- 'and decompress (string-parser)': {
- topic: function(compressed) {
- return decompress(compressed, this.callback, snappy.parsers.string);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in a string': function(err, result) {
- return assert.isString(result);
- },
- 'should equal the original when parsed': function(err, result) {
- return assert.strictEqual(result, buffer.toString("utf8"));
- }
- },
- 'and decompress (no parser)': {
- topic: function(compressed) {
- return decompress(compressed, this.callback);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in a buffer': function(err, result) {
- return Buffer.isBuffer(result);
- },
- 'should equal the original': function(err, result) {
- return assert.strictEqual(result.toString("utf8"), buffer.toString("utf8"));
- }
- }
- },
- "json": {
- topic: function() {
- return compress(json, this.callback);
- },
- 'should not have errors': function(err, compressed) {
- return assert.isNull(err);
- },
- 'should result in a buffer': function(err, compressed) {
- return Buffer.isBuffer(compressed);
- },
- 'and isValidCompressed': {
- topic: function(compressed) {
- return isValidCompressed(compressed, this.callback);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in true': function(err, result) {
- return assert.isTrue(result);
- }
- },
- 'and decompress (json-parser)': {
- topic: function(compressed) {
- return decompress(compressed, this.callback, snappy.parsers.json);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in json': function(err, result) {
- return assert.instanceOf(result, Object);
- },
- 'should equal the original': function(err, result) {
- return assert.deepEqual(result, json);
- }
- },
- 'and decompress (string-parser)': {
- topic: function(compressed) {
- return decompress(compressed, this.callback, snappy.parsers.string);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in a string': function(err, result) {
- return assert.isString(result);
- },
- 'should equal the original when parsed': function(err, result) {
- return assert.deepEqual(JSON.parse(result), json);
- }
- },
- 'and decompress (no parser)': {
- topic: function(compressed) {
- return decompress(compressed, this.callback);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in a buffer': function(err, result) {
- return Buffer.isBuffer(result);
- },
- 'should equal the original when parsed': function(err, result) {
- return assert.deepEqual(JSON.parse(result), json);
- }
- }
- },
- "string": {
- topic: function() {
- return compress(string, this.callback);
- },
- 'should not have errors': function(err, compressed) {
- return assert.isNull(err);
- },
- 'should result in a buffer': function(err, compressed) {
- return Buffer.isBuffer(compressed);
- },
- 'and isValidCompressed': {
- topic: function(compressed) {
- return isValidCompressed(compressed, this.callback);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in true': function(err, result) {
- return assert.isTrue(result);
- }
- },
- 'and decompress (string-parser)': {
- topic: function(compressed) {
- return decompress(compressed, this.callback, snappy.parsers.string);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in a string': function(err, result) {
- return assert.isString(result);
- },
- 'should equal the original': function(err, result) {
- return assert.strictEqual(result, string);
- }
- },
- 'and decompress (no parser)': {
- topic: function(compressed) {
- return decompress(compressed, this.callback);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in a Buffer': function(err, result) {
- return Buffer.isBuffer(result);
- },
- 'should equal the original when parsed': function(err, result) {
- var string2;
- string2 = result.toString("utf8");
- return assert.strictEqual(string2, string);
- }
- }
- }
- },
- "decompress": {
- "buffer (invalid)": {
- topic: function() {
- return decompress(buffer, this.callback, snappy.parsers.string);
- },
- 'should have error': function(err, result) {
- return assert.isError(err);
- },
- 'should have "Invalid input"-error': function(err, result) {
- return assert.strictEqual(err.message, "Invalid input");
- }
- }
- },
- "isValidCompressed": {
- "buffer (invalid)": {
- topic: function() {
- return isValidCompressed(buffer, this.callback);
- },
- 'should not have errors': function(err, result) {
- return assert.isNull(err);
- },
- 'should result in false': function(err, result) {
- return assert.isFalse(result);
- }
- }
- }
- }).export(module);
-});
View
241 test/async-test.js
@@ -0,0 +1,241 @@
+/*
+ Copyright (c) 2011 David Björklund
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+var snappy = require('../lib/snappy');
+var vows = require('vows');
+var assert = require('assert');
+
+// Convenient helper method
+assert.isError = function(err) {
+ return assert.instanceOf(err, Error);
+};
+
+// Test data
+var string = "foo foo foo Fasfa daos asd foo foo foo asdasf bar bar aarr";
+var buffer = new Buffer([255, 200, 100, 3, 0, 256, 80]);
+var json = {
+ "foo": "bar",
+ "fou": 0,
+ "shou": "ho ho",
+ "what?": ["hey", "you"]
+};
+var compress = snappy.compress;
+var decompress = snappy.decompress;
+var isValidCompressed = snappy.isValidCompressed;
+
+// Describe the test suite
+vows.describe("snappy (asyncronous)").addBatch({
+ "compress": {
+ "Buffer": {
+ topic: function() {
+ compress(buffer, this.callback);
+ },
+ 'should not have errors': function(err, compressed) {
+ assert.isNull(err);
+ },
+ 'should result in a buffer': function(err, compressed) {
+ Buffer.isBuffer(compressed);
+ },
+ 'and isValidCompressed': {
+ topic: function(compressed) {
+ isValidCompressed(compressed, this.callback);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in true': function(err, result) {
+ assert.isTrue(result);
+ }
+ },
+ 'and decompress (string-parser)': {
+ topic: function(compressed) {
+ decompress(compressed, this.callback, snappy.parsers.string);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in a string': function(err, result) {
+ assert.isString(result);
+ },
+ 'should equal the original when parsed': function(err, result) {
+ assert.strictEqual(result, buffer.toString("utf8"));
+ }
+ },
+ 'and decompress (no parser)': {
+ topic: function(compressed) {
+ decompress(compressed, this.callback);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in a buffer': function(err, result) {
+ Buffer.isBuffer(result);
+ },
+ 'should equal the original': function(err, result) {
+ assert.strictEqual(result.toString("utf8"), buffer.toString("utf8"));
+ }
+ }
+ },
+ "json": {
+ topic: function() {
+ compress(json, this.callback);
+ },
+ 'should not have errors': function(err, compressed) {
+ assert.isNull(err);
+ },
+ 'should result in a buffer': function(err, compressed) {
+ Buffer.isBuffer(compressed);
+ },
+ 'and isValidCompressed': {
+ topic: function(compressed) {
+ isValidCompressed(compressed, this.callback);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in true': function(err, result) {
+ assert.isTrue(result);
+ }
+ },
+ 'and decompress (json-parser)': {
+ topic: function(compressed) {
+ decompress(compressed, this.callback, snappy.parsers.json);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in json': function(err, result) {
+ assert.instanceOf(result, Object);
+ },
+ 'should equal the original': function(err, result) {
+ assert.deepEqual(result, json);
+ }
+ },
+ 'and decompress (string-parser)': {
+ topic: function(compressed) {
+ decompress(compressed, this.callback, snappy.parsers.string);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in a string': function(err, result) {
+ assert.isString(result);
+ },
+ 'should equal the original when parsed': function(err, result) {
+ assert.deepEqual(JSON.parse(result), json);
+ }
+ },
+ 'and decompress (no parser)': {
+ topic: function(compressed) {
+ decompress(compressed, this.callback);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in a buffer': function(err, result) {
+ Buffer.isBuffer(result);
+ },
+ 'should equal the original when parsed': function(err, result) {
+ assert.deepEqual(JSON.parse(result), json);
+ }
+ }
+ },
+ "string": {
+ topic: function() {
+ compress(string, this.callback);
+ },
+ 'should not have errors': function(err, compressed) {
+ assert.isNull(err);
+ },
+ 'should result in a buffer': function(err, compressed) {
+ Buffer.isBuffer(compressed);
+ },
+ 'and isValidCompressed': {
+ topic: function(compressed) {
+ isValidCompressed(compressed, this.callback);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in true': function(err, result) {
+ assert.isTrue(result);
+ }
+ },
+ 'and decompress (string-parser)': {
+ topic: function(compressed) {
+ decompress(compressed, this.callback, snappy.parsers.string);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in a string': function(err, result) {
+ assert.isString(result);
+ },
+ 'should equal the original': function(err, result) {
+ assert.strictEqual(result, string);
+ }
+ },
+ 'and decompress (no parser)': {
+ topic: function(compressed) {
+ decompress(compressed, this.callback);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in a Buffer': function(err, result) {
+ Buffer.isBuffer(result);
+ },
+ 'should equal the original when parsed': function(err, result) {
+ var string2;
+ string2 = result.toString("utf8");
+ assert.strictEqual(string2, string);
+ }
+ }
+ }
+ },
+ "decompress": {
+ "buffer (invalid)": {
+ topic: function() {
+ decompress(buffer, this.callback, snappy.parsers.string);
+ },
+ 'should have error': function(err, result) {
+ assert.isError(err);
+ },
+ 'should have "Invalid input"-error': function(err, result) {
+ assert.strictEqual(err.message, "Invalid input");
+ }
+ }
+ },
+ "isValidCompressed": {
+ "buffer (invalid)": {
+ topic: function() {
+ isValidCompressed(buffer, this.callback);
+ },
+ 'should not have errors': function(err, result) {
+ assert.isNull(err);
+ },
+ 'should result in false': function(err, result) {
+ assert.isFalse(result);
+ }
+ }
+ }
+}).export(module);
View
192 test/sync-test.js
@@ -0,0 +1,192 @@
+/*
+ Copyright (c) 2011 David Björklund
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+var snappy = require('../lib/snappy');
+var vows = require('vows');
+var assert = require('assert');
+
+// Convenient helper method
+assert.isError = function(err) {
+ return assert.instanceOf(Error);
+};
+
+// Test data
+var string = "foo foo foo Fasfa daos asd foo foo foo asdasf bar bar aarr";
+var buffer = new Buffer([255, 200, 100, 3, 0, 256, 80]);
+var json = {
+ "foo": "bar",
+ "fou": 0,
+ "shou": "ho ho",
+ "what?": ["hey", "you"]
+};
+var compress = snappy.compressSync;
+var decompress = snappy.decompressSync;
+var isValidCompressed = snappy.isValidCompressedSync;
+
+// Describe the test suite
+return vows.describe("snappy (syncronous)").addBatch({
+ "compress": {
+ "Buffer": {
+ topic: function() {
+ return compress(buffer);
+ },
+ 'should result in a buffer': function(compressed) {
+ return Buffer.isBuffer(compressed);
+ },
+ 'and isValidCompressed': {
+ topic: function(compressed) {
+ return isValidCompressed(compressed);
+ },
+ 'should result in true': function(result) {
+ return assert.isTrue(result);
+ }
+ },
+ 'and decompress (string-parser)': {
+ topic: function(compressed) {
+ return decompress(compressed, snappy.parsers.string);
+ },
+ 'should result in a string': function(result) {
+ return assert.isString(result);
+ },
+ 'should equal the original when parsed': function(result) {
+ return assert.strictEqual(result, buffer.toString("utf8"));
+ }
+ },
+ 'and decompress (no parser)': {
+ topic: function(compressed) {
+ return decompress(compressed);
+ },
+ 'should result in a buffer': function(result) {
+ return Buffer.isBuffer(result);
+ },
+ 'should equal the original': function(result) {
+ return assert.strictEqual(result.toString("utf8"), buffer.toString("utf8"));
+ }
+ }
+ },
+ "json": {
+ topic: function() {
+ return compress(json);
+ },
+ 'should result in a buffer': function(compressed) {
+ return Buffer.isBuffer(compressed);
+ },
+ 'and isValidCompressed': {
+ topic: function(compressed) {
+ return isValidCompressed(compressed);
+ },
+ 'should result in true': function(result) {
+ return assert.isTrue(result);
+ }
+ },
+ 'and decompress (json-parser)': {
+ topic: function(compressed) {
+ return decompress(compressed, snappy.parsers.json);
+ },
+ 'should result in json': function(result) {
+ return assert.instanceOf(result, Object);
+ },
+ 'should equal the original': function(result) {
+ return assert.deepEqual(result, json);
+ }
+ },
+ 'and decompress (string-parser)': {
+ topic: function(compressed) {
+ return decompress(compressed, snappy.parsers.string);
+ },
+ 'should result in a string': function(result) {
+ return assert.isString(result);
+ },
+ 'should equal the original when parsed': function(result) {
+ return assert.deepEqual(JSON.parse(result), json);
+ }
+ },
+ 'and decompress (no parser)': {
+ topic: function(compressed) {
+ return decompress(compressed);
+ },
+ 'should result in a buffer': function(result) {
+ return Buffer.isBuffer(result);
+ },
+ 'should equal the original when parsed': function(result) {
+ return assert.deepEqual(JSON.parse(result), json);
+ }
+ }
+ },
+ "string": {
+ topic: function() {
+ return compress(string);
+ },
+ 'should result in a buffer': function(compressed) {
+ return Buffer.isBuffer(compressed);
+ },
+ 'and isValidCompressed': {
+ topic: function(compressed) {
+ return isValidCompressed(compressed);
+ },
+ 'should result in true': function(result) {
+ return assert.isTrue(result);
+ }
+ },
+ 'and decompress (string-parser)': {
+ topic: function(compressed) {
+ return decompress(compressed, snappy.parsers.string);
+ },
+ 'should result in a string': function(result) {
+ return assert.isString(result);
+ },
+ 'should equal the original': function(result) {
+ return assert.strictEqual(result, string);
+ }
+ },
+ 'and decompress (no parser)': {
+ topic: function(compressed) {
+ return decompress(compressed);
+ },
+ 'should result in a Buffer': function(result) {
+ return Buffer.isBuffer(result);
+ },
+ 'should equal the original when parsed': function(result) {
+ var string2;
+ string2 = result.toString("utf8");
+ return assert.strictEqual(string2, string);
+ }
+ }
+ }
+ },
+ "decompress buffer (invalid) should throw": function() {
+ try {
+ decompress(buffer, snappy.parsers.string);
+ assert.isTrue(false);
+ } catch (e) {}
+ },
+ "isValidCompressed": {
+ "buffer (invalid)": {
+ topic: function() {
+ return isValidCompressed(buffer);
+ },
+ 'should result in false': function(result) {
+ return assert.isFalse(result);
+ }
+ }
+ }
+}).export(module);
Please sign in to comment.
Something went wrong with that request. Please try again.