Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: [ { Code: [Object], Message: [Object] } ], #71

Open
Zorrow2008 opened this issue Jan 12, 2017 · 3 comments
Open

Error: [ { Code: [Object], Message: [Object] } ], #71

Zorrow2008 opened this issue Jan 12, 2017 · 3 comments

Comments

@Zorrow2008
Copy link

Zorrow2008 commented Jan 12, 2017

Hello,

I implemented this meteor package and I am getting this error message.

I20170110-20:50:42.011(-8)? title:Building Java Programs
I20170110-20:50:42.012(-8)? author:Stuart Reges
I20170110-20:50:42.248(-8)? { '$': { xmlns: 'http://ecs.amazonaws.com/doc/2013-08-01/' },
I20170110-20:50:42.248(-8)? Error: [ { Code: [Object], Message: [Object] } ],
I20170110-20:50:42.248(-8)? RequestId: [ 'a5d13542-51ec-4868-9662-172160dc4001' ] }

Why is this occuring?
Any help would be appreciated.

@t3chnoboy
Copy link
Owner

Hi!
Can you please provide some more info and post the code?

@Zorrow2008
Copy link
Author

Zorrow2008 commented Jan 13, 2017

I am building a Meteor application that will take a search input from the user and use Amazon's itemSearch operation to find and return information about the book( I would like its ISBN, title, and author for now).

I created a Meteor method to do so and when the user enters submit on the search form ,I believe I call the method.

Here is my meteor method code:

Meteor.methods({
  	itemSearch(title, author) {
  		console.log("title:" + title);
  		console.log("author:" + author);
		client.itemSearch({
		  	title: title,
		  	author: author,
		  	searchIndex: 'Books',		 	
		  	responseGroup: 'ItemAttributes,Offers,Images,Small'
		}).then(function(results){
		  console.log(results);
		}).catch(function(err){
		  console.log(err);
	   	});
  	}
});

Here is my javascript code in response to a user submitting the search form:

Template.bookSearch.events({
  	'submit form' ( event, template ) {
    	event.preventDefault();
    	var title = event.target.title.value;
		var author = event.target.author.value;
		console.log("title = " + title);
		console.log("author = " + author);
		Meteor.call( 'itemSearch', title, author, ( error, response ) => {
          if ( error ) {
            Bert.alert( error.reason, 'danger' );
          } else {
            Bert.alert( 'itemSearch was called', 'success' );
          }
        });  
	}	
})

I am getting the alert saying that itemSearch was called successfully, so I think I am accessing the api . I don't understand what the error message I'm getting means however.

@t3chnoboy
Copy link
Owner

The code looks good. Can you make sure the credentials are valid?
Can you also print the full error object? That would be very helpful.
Here's how you can do it http://stackoverflow.com/questions/10729276/how-can-i-get-the-full-object-in-node-jss-console-log-rather-than-object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants