Skip to content

Commit

Permalink
Debugging 500 status code
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-aravind committed Feb 7, 2024
1 parent 1d51ac7 commit 1930ec9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37505,6 +37505,7 @@ const axios = __nccwpck_require__(6449);


async function run() {
let artsDataApiResponse;
try {
const artifactName = core.getInput('artifact_name');
const pageUrl = core.getInput('page_url');
Expand All @@ -37514,13 +37515,13 @@ async function run() {
const group = core.getInput('group');

// Construct data payload
const today = new Date();
const today = new Date().toISOString().replace(/:/g, "_")
const data = {
artifact: artifactName,
comment: `Entities from ${pageUrl}`,
publisher: publisherUri,
group: group,
version: today.toISOString(),
version: today,
downloadUrl: downloadUrl,
downloadFile: downloadFile,
reportCallbackUrl: 'https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus'
Expand All @@ -37529,16 +37530,14 @@ async function run() {
console.log('Data:', data)

// Perform HTTP request
const response = await axios.post('http://api.artsdata.ca/databus/', data, {
artsDataApiResponse = await axios.post('http://api.artsdata.ca/databus/', data, {
headers: {
'Content-Type': 'application/json'
}
});

console.log('Response:', response.message);
core.setOutput('response', response.message);
} catch (error) {
console.log('Error:', error.message)
console.log('Error:', error.response?.data)
core.setFailed(error.message);
}
}
Expand Down
11 changes: 5 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const axios = require('axios');


async function run() {
let artsDataApiResponse;
try {
const artifactName = core.getInput('artifact_name');
const pageUrl = core.getInput('page_url');
Expand All @@ -13,13 +14,13 @@ async function run() {
const group = core.getInput('group');

// Construct data payload
const today = new Date();
const today = new Date().toISOString().replace(/:/g, "_")
const data = {
artifact: artifactName,
comment: `Entities from ${pageUrl}`,
publisher: publisherUri,
group: group,
version: today.toISOString(),
version: today,
downloadUrl: downloadUrl,
downloadFile: downloadFile,
reportCallbackUrl: 'https://huginn-staging.herokuapp.com/users/1/web_requests/273/databus'
Expand All @@ -28,16 +29,14 @@ async function run() {
console.log('Data:', data)

// Perform HTTP request
const response = await axios.post('http://api.artsdata.ca/databus/', data, {
artsDataApiResponse = await axios.post('http://api.artsdata.ca/databus/', data, {
headers: {
'Content-Type': 'application/json'
}
});

console.log('Response:', response.message);
core.setOutput('response', response.message);
} catch (error) {
console.log('Error:', error.message)
console.log('Error:', error.response?.data)
core.setFailed(error.message);
}
}
Expand Down

0 comments on commit 1930ec9

Please sign in to comment.