Comments (4)
All the errors that happen after we make the service call to the storage service are returned in the callback. The errors that happen before(mainly argument, invalid operation issues) are thrown.
We are fine with exposing the validation-utilities. But can you please tell us how you would avoid the exception if we exposed the validation methods?
from azure-storage-node.
I have a module that has azure-storage-node
as a dependency and the table name is set programmatically. In version 0.2.0 the validation utilities was exposed and I used it similar to this:
var AzureStorage = require('azure-storage');
function callback(e) {
if (!!e) {
return console.log('error', e.message);
}
console.log('success');
}
var tableName = 'cache-me';
var tableService = AzureStorage.createTableService('UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://127.0.0.1;');
AzureStorage.Validate.tableNameIsValid(tableName, function (verr) {
if (verr) {
return callback(verr);
}
tableService.createTableIfNotExists(tableName, function (err) {
callback(err);
});
});
In the current version I would be forced to implement it like this:
try {
tableService.createTableIfNotExists('in-valid', function (err) {
callback(err);
});
} catch (verr) {
callback(verr);
}
that, imho, kind of breaks the asynchronous pattern of node.
On the wish list it would be great if the validation returned the error in the callback. I would make a proper PR but I'm out of office and have a hard time to get the CLA signed by my employer.
from azure-storage-node.
Thank you for the detailed explanation. As I mentioned before, all the errors that happen after we make the service call to the storage service are returned in the callback. The errors that happen before(mainly argument, invalid operation issues) are thrown. This is in line with the documentation here - https://www.joyent.com/developers/node/design/errors.
We are however going to expose the validation utils in an upcoming release so you can continue using your code. Thanks!
from azure-storage-node.
We have fixed this in our latest release (0.3.1). Please upgrade to the latest.
from azure-storage-node.
Related Issues (20)
- Getting SAS policy expiration date from blob and queue HOT 1
- "blob show" command fails with "invalid usage of '_'" after underscore update HOT 1
- Could you help remove the vulnerabilities introduced in azure-storage ? HOT 9
- Is there a migration documentation to the azure-sdk-for-js lib? HOT 2
- Feature Request: Add scalability for US Gov tenants HOT 3
- How to read blob line by line? HOT 1
- An HTTP header that's mandatory for this request is not specified
- Vulnerability "Inefficient Regular Expression Complexity in validator.js" HOT 9
- Vulnerability - JSONSCHEMA-1920922 HOT 3
- Crashes node JS application on DNS failure HOT 2
- [Note]Deprecating the package.
- Download from Blob storage gets stuck sometimes and never completes HOT 1
- Remove dependency for md5.js
- generateBlobSASQueryParameters
- This repo is missing important files
- azure-storage.blob.mjs:45055 Uncaught SyntaxError: Unexpected end of input
- xml2js security vulnerability. Needs to be updated to 0.5.0 manually HOT 1
- Issue encountered at image push to blob storage HOT 1
- Deprecated npm package request is in use
- xml2js security issue for version 0.2.8 in azure-storage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-storage-node.