{"record":{"id":"c7a0d31cbda8cef9","repo":"CanineHQ/canine","slug":"failed-to-add-resource","errorCode":null,"errorMessage":"Failed to add resource","messagePattern":"Failed to add resource","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app/javascript/controllers/team_resource_search_controller.js","lineNumber":59,"sourceCode":"          <span class=\"loading loading-spinner loading-sm\"></span>\n          <span>Adding ${this.escapeHtml(resource.name)}...</span>\n        </div>\n      `\n\n      const response = await fetch(this.addUrlValue, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json',\n          'X-CSRF-Token': this.getCsrfToken()\n        },\n        body: JSON.stringify({\n          resourceable_type: this.resourceTypeValue,\n          resourceable_id: resource.id\n        })\n      })\n\n      if (!response.ok) {\n        throw new Error('Failed to add resource')\n      }\n\n      // Close the modal\n      const modal = this.element.closest('dialog')\n      if (modal) {\n        modal.close()\n      }\n\n      // Reload the turbo frame\n      if (this.hasTurboFrameValue) {\n        const frame = document.getElementById(this.turboFrameValue)\n        if (frame) {\n          frame.reload()\n        }\n      } else {\n        window.location.reload()\n      }\n    } catch (error) {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/CanineHQ/canine/blob/ba4ee3968d8513ee27d8583fbd3e854a8dd053f3/app/javascript/controllers/team_resource_search_controller.js#L41-L77","documentation":"Error \"Failed to add resource\" thrown in CanineHQ/canine.","triggerScenarios":"Thrown at app/javascript/controllers/team_resource_search_controller.js:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ba4ee3968d8513ee27d8583fbd3e854a8dd053f3","analyzedAt":"2026-08-23T17:49:27.834Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}