Skip to content

Commit

Permalink
remove debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Sep 11, 2024
1 parent 54115e1 commit a4e88e8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
4 changes: 0 additions & 4 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ export function getAuthType() {

export function checkForValidCreds(instanceUrl?: string, token?: string) {
try {
console.log('checking4', instanceUrl, token);
const responseContent = Api.fetch('SitesManager.getSitesIdWithAtLeastViewAccess', {}, {
instanceUrl,
token,
});
console.log('checking4', responseContent, Array.isArray(responseContent), !!responseContent.length);
return Array.isArray(responseContent) && !!responseContent.length;
} catch (error) {
console.log('checking4', error.message, error.stack);
debugLog('checkForValidCreds:', 'failed to get sites ID with parameters', error.stack || error.message);
return false;
}
Expand All @@ -38,7 +35,6 @@ export function setCredentials(request) {
const instanceUrl = username;

const isValidCreds = checkForValidCreds(instanceUrl, token);
console.log('checking4', instanceUrl, token, isValidCreds);

if (!isValidCreds) {
return {
Expand Down
1 change: 0 additions & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function throwUserError(message: string) {
*/
export function throwUnexpectedError(message: string) {
try {
console.log('checking4', 'error!', message);
const time = (new Date()).toString();
const wholeMessage = `An error has occurred - if you need help, please reach out in the Forums here: ${FORUM_URL} or `
+ `contact us by email at [email protected] (in your message, please use Looker Studio in the subject, and copy paste the error message). `
Expand Down
1 change: 1 addition & 0 deletions tests/appscript/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ describe('api', () => {
},
});

// waiting seems to be required here, or the mock server isn't used in time
await new Promise((resolve) => setTimeout(resolve, 5000));

// use the mock server's path that forces a non-random error
Expand Down
1 change: 0 additions & 1 deletion tests/appscript/api/mockServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function makeApiFailureMockServer(port: number = 3000, options: MockServe
const app = new Koa();

app.use(async (ctx) => {
console.log(`handling url in mock server ${ctx.url}`);
const { pathname, search } = new URL(`http://ignored.com${ctx.url}`);

const body = await getBody(ctx.req);
Expand Down

0 comments on commit a4e88e8

Please sign in to comment.